From: Antonin Descampe Date: Mon, 29 Sep 2014 12:03:50 +0000 (+0000) Subject: [trunk] Ensure cblk->data pointer is correctly initialized (updates issue 391). Still... X-Git-Tag: wg1n6848~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f08af3ed827471cb6ceb369b755a6fc4f9619df4;p=openjpeg [trunk] Ensure cblk->data pointer is correctly initialized (updates issue 391). Still need to check if it does not fail anymore with ASan. --- diff --git a/src/lib/openjp2/t2.c b/src/lib/openjp2/t2.c index ec603dc4..1bcb52ca 100644 --- a/src/lib/openjp2/t2.c +++ b/src/lib/openjp2/t2.c @@ -1163,6 +1163,7 @@ OPJ_BOOL opj_t2_read_packet_data( opj_t2_t* p_t2, OPJ_BYTE* new_cblk_data = (OPJ_BYTE*) opj_realloc(l_cblk->data, l_cblk->data_current_size + l_seg->newlen); if(! new_cblk_data) { opj_free(l_cblk->data); + l_cblk->data = NULL; l_cblk->data_max_size = 0; /* opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to realloc code block cata!\n"); */ return OPJ_FALSE;