diff options
| author | Mirco Miranda <mircomir@users.noreply.github.com> | 2025-02-11 13:05:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-11 13:05:58 +0100 |
| commit | 578c67b3291042377ab3aa82265a304d3fdfed4a (patch) | |
| tree | 0d2525ec84eaacba1dae440f6f8a2a308a1a38ab /src/lib/openjp2 | |
| parent | 44119c2db51911056e1227e46a0ea883e3d73fbf (diff) | |
Fixed ICC profile copy failure on write (#1574)
Diffstat (limited to 'src/lib/openjp2')
| -rw-r--r-- | src/lib/openjp2/jp2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c index da506318..3d16d107 100644 --- a/src/lib/openjp2/jp2.c +++ b/src/lib/openjp2/jp2.c @@ -1987,6 +1987,12 @@ 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) { |
