summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-06-22 22:35:44 +0200
committerGitHub <noreply@github.com>2020-06-22 22:35:44 +0200
commit172c8ae5cf230ff74b5814daf29e5b577aa30a9b (patch)
tree123e45f8452cf9a6d4d6f89858db1534226f9d12 /src/lib
parente252438d5e23e6ba9561e73a5a4754713bfd626a (diff)
parentb028e8d1ce7798f61c35b1b20d836f80d78a35d0 (diff)
Merge pull request #1260 from sebras/fix-issue-1259
openjp2: Plug image leak when failing to allocate codestream index.
Diffstat (limited to 'src/lib')
-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;
}