summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-run.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-07-18 15:35:59 +0100
committerRobin Watts <robin.watts@artifex.com>2017-07-19 19:41:22 +0100
commit7a25da923d28e55e39dd7a62360960e3f5aa1994 (patch)
tree4c47b60b8f7c5605b15733f1916bb8755dbc50e7 /source/pdf/pdf-run.c
parentc56b659155991d0c8839ca38244056d9c5abf0f2 (diff)
downloadmupdf-7a25da923d28e55e39dd7a62360960e3f5aa1994.tar.xz
Fix colorspace leaks with group colorspaces.
Diffstat (limited to 'source/pdf/pdf-run.c')
-rw-r--r--source/pdf/pdf-run.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/pdf/pdf-run.c b/source/pdf/pdf-run.c
index 7bff750b..b484f1d1 100644
--- a/source/pdf/pdf-run.c
+++ b/source/pdf/pdf-run.c
@@ -72,9 +72,14 @@ pdf_run_page_contents_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *p
}
else
{
- colorspace = fz_default_output_intent(ctx, default_cs);
+ colorspace = fz_keep_colorspace(ctx, fz_default_output_intent(ctx, default_cs));
}
- fz_begin_group(ctx, dev, fz_transform_rect(&mediabox, &local_ctm), colorspace, 1, 0, 0, 1);
+ fz_try(ctx)
+ fz_begin_group(ctx, dev, fz_transform_rect(&mediabox, &local_ctm), colorspace, 1, 0, 0, 1);
+ fz_always(ctx)
+ fz_drop_colorspace(ctx, colorspace);
+ fz_catch(ctx)
+ fz_rethrow(ctx);
}
proc = pdf_new_run_processor(ctx, dev, &local_ctm, usage, NULL, 0);