diff options
-rw-r--r-- | source/fitz/draw-device.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index 8c7ce352..72498322 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -2580,11 +2580,17 @@ fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, { fz_rasterizer *rast = fz_new_rasterizer(ctx, NULL); - if (stroke) - (void)fz_flatten_stroke_path(ctx, rast, path, stroke, ctm, flatness, linewidth, scissor, bbox); - else - (void)fz_flatten_fill_path(ctx, rast, path, ctm, flatness, scissor, bbox); - fz_drop_rasterizer(ctx, rast); + fz_try(ctx) + { + if (stroke) + (void)fz_flatten_stroke_path(ctx, rast, path, stroke, ctm, flatness, linewidth, scissor, bbox); + else + (void)fz_flatten_fill_path(ctx, rast, path, ctm, flatness, scissor, bbox); + } + fz_always(ctx) + fz_drop_rasterizer(ctx, rast); + fz_catch(ctx) + fz_rethrow(ctx); return bbox; } |