From b306a1bdd8622afd226946879046a360021026df Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 22 May 2013 17:30:17 +0100 Subject: Fix from zeniko for memory leak in fz_load_jpx --- fitz/image_jpx.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fitz') 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"); -- cgit v1.2.3