Merge pull request #1260 from sebras/fix-issue-1259

openjp2: Plug image leak when failing to allocate codestream index.
This commit is contained in:
Even Rouault 2020-06-22 22:35:44 +02:00 committed by GitHub
commit 172c8ae5cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -8293,6 +8293,8 @@ OPJ_BOOL opj_j2k_read_header(opj_stream_private_t *p_stream,
/*Allocate and initialize some elements of codestrem index*/ /*Allocate and initialize some elements of codestrem index*/
if (!opj_j2k_allocate_tile_element_cstr_index(p_j2k)) { if (!opj_j2k_allocate_tile_element_cstr_index(p_j2k)) {
opj_image_destroy(*p_image);
*p_image = NULL;
return OPJ_FALSE; return OPJ_FALSE;
} }