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-jxr.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source/fitz/load-jxr.c') diff --git a/source/fitz/load-jxr.c b/source/fitz/load-jxr.c index 789fcfe6..f603ee57 100644 --- a/source/fitz/load-jxr.c +++ b/source/fitz/load-jxr.c @@ -401,15 +401,15 @@ fz_load_jxr(fz_context *ctx, const unsigned char *data, size_t size) fz_var(image); - jxr_read_image(ctx, data, size, &info, 0); + fz_try(ctx) + { + jxr_read_image(ctx, data, size, &info, 0); - image = fz_new_pixmap(ctx, info.cspace, info.width, info.height, NULL, 1); + image = fz_new_pixmap(ctx, info.cspace, info.width, info.height, NULL, 1); - image->xres = info.xres; - image->yres = info.yres; + image->xres = info.xres; + image->yres = info.yres; - fz_try(ctx) - { fz_unpack_tile(ctx, image, info.samples, fz_colorspace_n(ctx, info.cspace) + 1, 8, info.stride, 0); if (info.has_alpha && !info.has_premul) fz_premultiply_pixmap(ctx, image); @@ -417,7 +417,6 @@ fz_load_jxr(fz_context *ctx, const unsigned char *data, size_t size) fz_always(ctx) { fz_free(ctx, info.samples); - fz_drop_colorspace(ctx, info.cspace); } fz_catch(ctx) { -- cgit v1.2.3