From 4ccc9cdc72346175fd22aafbce03847f1e287d26 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 31 Jan 2018 18:31:07 +0100 Subject: Drop JPEG/J2K/JPEG-XR/PNG/TIFF colorspaces even upon exception. For TIFF it was not just the colorspace, but other data as well. --- source/fitz/load-jpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/fitz/load-jpeg.c') diff --git a/source/fitz/load-jpeg.c b/source/fitz/load-jpeg.c index b088325b..87b32431 100644 --- a/source/fitz/load-jpeg.c +++ b/source/fitz/load-jpeg.c @@ -379,7 +379,7 @@ fz_load_jpeg_info(fz_context *ctx, const unsigned char *rbuf, size_t rlen, int * struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr err; struct jpeg_source_mgr src; - fz_colorspace *icc; + fz_colorspace *icc = NULL; fz_try(ctx) { @@ -453,6 +453,7 @@ fz_load_jpeg_info(fz_context *ctx, const unsigned char *rbuf, size_t rlen, int * } fz_catch(ctx) { + fz_drop_colorspace(ctx, icc); fz_rethrow(ctx); } } -- cgit v1.2.3