From b7fe7d25e1fcffe3bca03b61da54a04d72cb7965 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Fri, 14 Mar 2014 12:27:01 +0000 Subject: [PATCH] [trunk] Prevent a leak when reading PPT markers Update issue 295 --- src/lib/openjp2/j2k.c | 1 + 1 file changed, 1 insertion(+) 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");