Skip to content

Commit

Permalink
Fixed ICC profile copy failure on write
Browse files Browse the repository at this point in the history
  • Loading branch information
mircomir committed Jan 24, 2025
1 parent 44119c2 commit d1ea3c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/openjp2/jp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1987,6 +1987,11 @@ OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2,
if (image->icc_profile_len) {
jp2->meth = 2;
jp2->enumcs = 0;
jp2->color.icc_profile_buf = (OPJ_BYTE *)opj_malloc(image->icc_profile_len);
if (jp2->color.icc_profile_buf) {
jp2->color.icc_profile_len = image->icc_profile_len;
memcpy(jp2->color.icc_profile_buf, image->icc_profile_buf, image->icc_profile_len);
}
} else {
jp2->meth = 1;
if (image->color_space == OPJ_CLRSPC_SRGB) {
Expand Down

0 comments on commit d1ea3c2

Please sign in to comment.