Skip to content

Commit d1ea3c2

Browse files
committed
Fixed ICC profile copy failure on write
1 parent 44119c2 commit d1ea3c2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/openjp2/jp2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,11 @@ OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2,
19871987
if (image->icc_profile_len) {
19881988
jp2->meth = 2;
19891989
jp2->enumcs = 0;
1990+
jp2->color.icc_profile_buf = (OPJ_BYTE *)opj_malloc(image->icc_profile_len);
1991+
if (jp2->color.icc_profile_buf) {
1992+
jp2->color.icc_profile_len = image->icc_profile_len;
1993+
memcpy(jp2->color.icc_profile_buf, image->icc_profile_buf, image->icc_profile_len);
1994+
}
19901995
} else {
19911996
jp2->meth = 1;
19921997
if (image->color_space == OPJ_CLRSPC_SRGB) {

0 commit comments

Comments
 (0)