summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-colorspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf/pdf-colorspace.c')
-rw-r--r--source/pdf/pdf-colorspace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/pdf/pdf-colorspace.c b/source/pdf/pdf-colorspace.c
index d112baa7..49f2354b 100644
--- a/source/pdf/pdf-colorspace.c
+++ b/source/pdf/pdf-colorspace.c
@@ -71,14 +71,17 @@ load_icc_based(fz_context *ctx, pdf_obj *dict, int alt)
fz_drop_buffer(ctx, buffer);
fz_catch(ctx)
{
- if (!alt)
+ if (!alt) {
+ fz_drop_colorspace(ctx, cs_alt);
fz_rethrow(ctx);
+ }
}
if (cs)
{
if (n != 1 && n != 3 && n != 4)
{
+ fz_drop_colorspace(ctx, cs_alt);
fz_drop_colorspace(ctx, cs);
fz_throw(ctx, FZ_ERROR_GENERIC, "ICC Based must have 1, 3 or 4 components");
}
@@ -94,7 +97,10 @@ load_icc_based(fz_context *ctx, pdf_obj *dict, int alt)
* or because we aren't in an ICC workflow. If we aren't allowed
* to return the alternate, then that's all she wrote. */
if (!alt)
+ {
+ fz_drop_colorspace(ctx, cs_alt);
fz_throw(ctx, FZ_ERROR_GENERIC, "Unable to read ICC workflow");
+ }
/* If we have an alternate we are allowed to use, return that. */
if (cs_alt)