summaryrefslogtreecommitdiff
path: root/source/xps
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-07-03 19:07:43 +0100
committerRobin Watts <robin.watts@artifex.com>2017-07-03 19:08:18 +0100
commitda3d22e4096f85d27dde527050f166261ae4bb14 (patch)
tree4ce6b8db35dbcd40e33ee20c00ccb64f687ed2a7 /source/xps
parent5b506261a266b1843302d7f0a74222671495feaa (diff)
downloadmupdf-da3d22e4096f85d27dde527050f166261ae4bb14.tar.xz
Don't leak fz_image if xps fails to parse tiling brush.
Diffstat (limited to 'source/xps')
-rw-r--r--source/xps/xps-image.c9
1 files changed, 6 insertions, 3 deletions
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);
}