summaryrefslogtreecommitdiff
path: root/fitz/image_jpx.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-05-22 17:30:17 +0100
committerRobin Watts <robin.watts@artifex.com>2013-05-24 18:13:18 +0100
commitb306a1bdd8622afd226946879046a360021026df (patch)
tree13bc292dca56f3e449258af9b8b195bfb6b2fe39 /fitz/image_jpx.c
parent859618a545a5c7fd009d889f68e8fdcd5929e8ce (diff)
downloadmupdf-b306a1bdd8622afd226946879046a360021026df.tar.xz
Fix from zeniko for memory leak in fz_load_jpx
Diffstat (limited to 'fitz/image_jpx.c')
-rw-r--r--fitz/image_jpx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fitz/image_jpx.c b/fitz/image_jpx.c
index 44081f6c..1c35c5fd 100644
--- a/fitz/image_jpx.c
+++ b/fitz/image_jpx.c
@@ -130,11 +130,14 @@ fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *defcs
{
opj_stream_destroy(stream);
opj_destroy_codec(codec);
+ opj_image_destroy(jpx);
fz_throw(ctx, "Failed to decode JPX image");
}
+ opj_stream_destroy(stream);
opj_destroy_codec(codec);
+ /* jpx should never be NULL here, but check anyway */
if (!jpx)
fz_throw(ctx, "opj_decode failed");