From: Mathieu Malaterre Date: Fri, 14 Mar 2014 12:27:01 +0000 (+0000) Subject: [trunk] Prevent a leak when reading PPT markers X-Git-Tag: version.2.0.1~4^2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7fe7d25e1fcffe3bca03b61da54a04d72cb7965;p=openjpeg [trunk] Prevent a leak when reading PPT markers Update issue 295 --- diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index 7a714f9b..93d9999c 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -3803,6 +3803,7 @@ static OPJ_BOOL opj_j2k_read_ppt ( opj_j2k_t *p_j2k, l_tcp->ppt_data_size = 0; l_tcp->ppt_len = p_header_size; + opj_free(l_tcp->ppt_buffer); l_tcp->ppt_buffer = (OPJ_BYTE *) opj_calloc(l_tcp->ppt_len, sizeof(OPJ_BYTE) ); if (l_tcp->ppt_buffer == 00) { opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPT marker\n");