diff options
author | Albert Astals Cid <aacid@kde.org> | 2020-03-22 12:32:02 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2020-03-22 12:32:02 +0100 |
commit | 4382264f1b96e6ad6c9e481e4ceae3c22dbcd2f3 (patch) | |
tree | fa436b07e56486bd99187d2d8ccb8a1b4e028c85 | |
parent | 5c601c40d84686134d90a0f862e2507bd628e188 (diff) |
Fix leak in broken files
oss-fuzz/21330
-rw-r--r-- | poppler/JPEG2000Stream.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc index 123da94a..997f1915 100644 --- a/poppler/JPEG2000Stream.cc +++ b/poppler/JPEG2000Stream.cc @@ -357,6 +357,10 @@ void JPXStreamPrivate::init2(OPJ_CODEC_FORMAT format, unsigned char *buf, int le return; error: + if (image != nullptr) { + opj_image_destroy(image); + image = nullptr; + } opj_stream_destroy(stream); opj_destroy_codec(decoder); if (format == OPJ_CODEC_JP2) { |