summaryrefslogtreecommitdiff
path: root/source/fitz/draw-path.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-09-30 16:45:15 +0100
committerRobin Watts <robin.watts@artifex.com>2013-09-30 17:21:43 +0100
commita8aec7875aaf6c8d8d4ed37ce74705988b73e9c1 (patch)
treebf936a0aad19b0d1a84da538f57be8e0c772c3e7 /source/fitz/draw-path.c
parent9805dec32d8b7cb2fcc3251fdb670f5065e5f57e (diff)
downloadmupdf-a8aec7875aaf6c8d8d4ed37ce74705988b73e9c1.tar.xz
Bug 694526: Spot non-invertable matrices and bale before stroking
The bug fix added in the previous commit fails to work in this case (hang-9527.pdf) because the matrix is not invertible and hence the clipping rectangle ends up infinite. Spot this case here and return early.
Diffstat (limited to 'source/fitz/draw-path.c')
-rw-r--r--source/fitz/draw-path.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/fitz/draw-path.c b/source/fitz/draw-path.c
index 6fa6191d..b33ea8b4 100644
--- a/source/fitz/draw-path.c
+++ b/source/fitz/draw-path.c
@@ -971,7 +971,8 @@ fz_flatten_dash_path(fz_gel *gel, fz_path *path, const fz_stroke_state *stroke,
for (i = 0; i < stroke->dash_len; i++)
phase_len += stroke->dash_list[i];
fz_gel_scissor(gel, &s.rect);
- fz_invert_matrix(&inv, ctm);
+ if (fz_try_invert_matrix(&inv, ctm))
+ return;
fz_transform_rect(&s.rect, &inv);
s.rect.x0 -= linewidth;
s.rect.x1 += linewidth;