summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2008-08-07 21:00:23 +0200
committerTor Andersson <tor@ghostscript.com>2008-08-07 21:00:23 +0200
commit16d8031a0a2f592acd37efd60eaab2d3eb004422 (patch)
tree45df1aa3658fdb380ffd268eb3716b7c19d0631e
parentede314b07e68ad38a9ac74b4fb67e83efdc99d62 (diff)
downloadmupdf-16d8031a0a2f592acd37efd60eaab2d3eb004422.tar.xz
Paranoia check that paths begin with a moveto in stroking logic.
-rw-r--r--raster/pathstroke.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/raster/pathstroke.c b/raster/pathstroke.c
index 0143742c..37609e36 100644
--- a/raster/pathstroke.c
+++ b/raster/pathstroke.c
@@ -479,6 +479,9 @@ fz_strokepath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, flo
i = 0;
+ if (path->len > 0 && path->els[0].k != FZ_MOVETO)
+ return fz_throw("path must begin with moveto");
+
while (i < path->len)
{
switch (path->els[i++].k)
@@ -679,6 +682,9 @@ fz_dashpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float
i = 0;
+ if (path->len > 0 && path->els[0].k != FZ_MOVETO)
+ return fz_throw("path must begin with moveto");
+
while (i < path->len)
{
switch (path->els[i++].k)