diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2017-09-13 19:55:21 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2017-09-20 15:29:12 +0200 |
commit | e90d30ba31ad20b63ee207c062f6fdf43ea91669 (patch) | |
tree | 5fbeaf8d5022033abb60a6d091d8a04cd7f333df /source | |
parent | 5af32f6d37ff59bf22bf76e4dfee65b119afcee1 (diff) | |
download | mupdf-e90d30ba31ad20b63ee207c062f6fdf43ea91669.tar.xz |
Drop rasterizer upon error while bounding path.
Diffstat (limited to 'source')
-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; } |