Export to GitHub

openjpeg - issue #66

opj_image_destroy doesn't free icc_profile_buf


Posted on Mar 2, 2011 by Helpful Hippo

What steps will reproduce the problem? 1. Load one of the JPXEncoded images contained in http://planeta.tc/upload-files/amino130M.pdf (e.g. through MuPDF) 2. Free the image

What is the expected output? What do you see instead? There's a memory leak caused by icc_profile_buf not being freed (the buffer is allocated in jp2_read_colr and assigned to the opj_jp2_t struct in jp2_decode).

Comment #1

Posted on Mar 6, 2011 by Quick Monkey

OpenJPEG-2.0.0-revision-737

libopenjpeg/jp2.c, jp2_read_colr(), line 1489:

/*else
{
    // do not care with profiles.
}*/

OpenJPEG-1.4.0-revision-737

libopenjpeg/jp2.c, jp2_read_colr(), line 574:

color->icc_profile_buf = (unsigned char*)opj_malloc(skip_len);
color->icc_profile_len = skip_len;

Zen: what are you writing about?

winfried

Comment #2

Posted on Mar 6, 2011 by Helpful Hippo

This is about http://code.google.com/p/openjpeg/source/browse/trunk/libopenjpeg/jp2.c - which I (apparently wrongly) assumed to be your latest version.

Comment #3

Posted on Jul 3, 2011 by Happy Rabbit

issue fixed.

Status: Fixed

Labels:
Type-Defect Priority-Medium