diff options
-rw-r--r-- | fitz/image_jpx.c | 3 |
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"); |