summaryrefslogtreecommitdiff
path: root/source/fitz/load-jpeg.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2018-01-31 18:31:07 +0100
committerSebastian Rasmussen <sebras@gmail.com>2018-02-01 17:21:16 +0100
commit4ccc9cdc72346175fd22aafbce03847f1e287d26 (patch)
tree6e6c81d3d4b38ff10cc7ea4f51301cb9b41beeca /source/fitz/load-jpeg.c
parentaa188d02031df0c96e785d4ea0ef0f95599827d1 (diff)
downloadmupdf-4ccc9cdc72346175fd22aafbce03847f1e287d26.tar.xz
Drop JPEG/J2K/JPEG-XR/PNG/TIFF colorspaces even upon exception.
For TIFF it was not just the colorspace, but other data as well.
Diffstat (limited to 'source/fitz/load-jpeg.c')
-rw-r--r--source/fitz/load-jpeg.c3
1 files changed, 2 insertions, 1 deletions
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);
}
}