summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2015-07-27 15:12:25 +0200
committerSebastian Rasmussen <sebras@gmail.com>2015-07-27 16:49:22 +0200
commitfd54bf89f2adfd5545202a6df87076fb7269f62c (patch)
treeaec33a413d99a3875e31c6b28a75b3d89ae569b5 /source
parentbb41e62125dea79b05ec2154a1db922802d152e0 (diff)
downloadmupdf-fd54bf89f2adfd5545202a6df87076fb7269f62c.tar.xz
Limit dash phase to length of dash pattern.
Previously out of range phase values were accepted which led to overly long loops when processing moveto. This could be triggered e.g. by 2222222222222222222 [ 4 6 ] 0 d in a content stream.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/draw-path.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/fitz/draw-path.c b/source/fitz/draw-path.c
index 9949e1d7..bf7a9022 100644
--- a/source/fitz/draw-path.c
+++ b/source/fitz/draw-path.c
@@ -1326,7 +1326,7 @@ fz_flatten_dash_path(fz_context *ctx, fz_gel *gel, fz_path *path, const fz_strok
if (s.dash_len > 0 && s.dash_total == 0)
return;
- s.dash_phase = stroke->dash_phase;
+ s.dash_phase = fmodf(stroke->dash_phase, s.dash_total);
s.cap = stroke->start_cap;
s.toggle = 0;
s.offset = 0;