This block of code in opj_jp2_setup_encoder at line 1986:
/* Colour Specification box */
if (image->icc_profile_len) {
jp2->meth = 2;
jp2->enumcs = 0;
} else {
appears to be missing these steps:
jp2->color.icc_profile_buf = image->icc_profile_buf
jp2->color.icc_profile_len = image->icc_profile_len
Otherwise later on, this block code generates an assert because
meth is set to 2 but the icc_profile_len is zero.
switch (jp2->meth) {
case 1 :
l_colr_size += 4; /* EnumCS */
break;
case 2 :
assert(jp2->color.icc_profile_len); /* ICC profile */
l_colr_size += jp2->color.icc_profile_len;
break;
default :
return 00;
}
Your comments most welcome.