Adding an icc profile om compression results in an assert in 2.5.3

21 views
Skip to first unread message

Steve McKenna

unread,
May 19, 2026, 10:30:34 AM (7 days ago) May 19
to OpenJPEG
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.

Steve McKenna

unread,
May 19, 2026, 10:37:40 AM (7 days ago) May 19
to OpenJPEG
SOLVED - this was fixed in 2.5.4...
Fixed ICC profile copy failure on write#1574

Reply all
Reply to author
Forward
Message has been deleted
0 new messages