summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2020-06-23 02:18:19 +0800
committerSebastian Rasmussen <sebras@gmail.com>2020-06-23 03:42:25 +0800
commitb028e8d1ce7798f61c35b1b20d836f80d78a35d0 (patch)
tree4d505eb568cf6bd28ee57112bcca8cfacf2fe8b8 /src
parent98150d09422149305c9c8648337a744df5786fbe (diff)
openjp2: Plug image leak when failing to allocate codestream index.
This fixes issue #1259.
Diffstat (limited to 'src')
-rw-r--r--src/lib/openjp2/j2k.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index c45b6742..4a4fd16c 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -8293,6 +8293,8 @@ OPJ_BOOL opj_j2k_read_header(opj_stream_private_t *p_stream,
/*Allocate and initialize some elements of codestrem index*/
if (!opj_j2k_allocate_tile_element_cstr_index(p_j2k)) {
+ opj_image_destroy(*p_image);
+ *p_image = NULL;
return OPJ_FALSE;
}