Skip to content

Commit 578c67b

Browse files
authored
Fixed ICC profile copy failure on write (#1574)
1 parent 44119c2 commit 578c67b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib/openjp2/jp2.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,12 @@ 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,
1994+
image->icc_profile_len);
1995+
}
19901996
} else {
19911997
jp2->meth = 1;
19921998
if (image->color_space == OPJ_CLRSPC_SRGB) {

0 commit comments

Comments
 (0)