From da3d22e4096f85d27dde527050f166261ae4bb14 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 3 Jul 2017 19:07:43 +0100 Subject: Don't leak fz_image if xps fails to parse tiling brush. --- source/xps/xps-image.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/xps') diff --git a/source/xps/xps-image.c b/source/xps/xps-image.c index 9408c528..c9870a01 100644 --- a/source/xps/xps-image.c +++ b/source/xps/xps-image.c @@ -122,7 +122,10 @@ xps_parse_image_brush(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, return; } - xps_parse_tiling_brush(ctx, doc, ctm, area, base_uri, dict, root, xps_paint_image_brush, image); - - fz_drop_image(ctx, image); + fz_try(ctx) + xps_parse_tiling_brush(ctx, doc, ctm, area, base_uri, dict, root, xps_paint_image_brush, image); + fz_always(ctx) + fz_drop_image(ctx, image); + fz_catch(ctx) + fz_rethrow(ctx); } -- cgit v1.2.3