summaryrefslogtreecommitdiff
path: root/source/fitz/load-tiff.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-tiff.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-tiff.c')
-rw-r--r--source/fitz/load-tiff.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c
index 80abd6f1..2da9e635 100644
--- a/source/fitz/load-tiff.c
+++ b/source/fitz/load-tiff.c
@@ -1374,6 +1374,7 @@ fz_load_tiff_subimage(fz_context *ctx, const unsigned char *buf, size_t len, int
fz_always(ctx)
{
/* Clean up scratch memory */
+ fz_drop_colorspace(ctx, tiff.colorspace);
fz_free(ctx, tiff.colormap);
fz_free(ctx, tiff.stripoffsets);
fz_free(ctx, tiff.stripbytecounts);
@@ -1420,14 +1421,18 @@ fz_load_tiff_info_subimage(fz_context *ctx, const unsigned char *buf, size_t len
fz_drop_colorspace(ctx, tiff.colorspace);
tiff.colorspace = fz_keep_colorspace(ctx, fz_device_rgb(ctx));
}
- *cspacep = tiff.colorspace;
+ *cspacep = fz_keep_colorspace(ctx, tiff.colorspace);
}
fz_always(ctx)
{
/* Clean up scratch memory */
+ fz_drop_colorspace(ctx, tiff.colorspace);
fz_free(ctx, tiff.colormap);
fz_free(ctx, tiff.stripoffsets);
fz_free(ctx, tiff.stripbytecounts);
+ fz_free(ctx, tiff.tileoffsets);
+ fz_free(ctx, tiff.tilebytecounts);
+ fz_free(ctx, tiff.data);
fz_free(ctx, tiff.samples);
fz_free(ctx, tiff.profile);
}