diff options
author | Tor Andersson <tor@ghostscript.com> | 2008-08-07 21:00:23 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2008-08-07 21:00:23 +0200 |
commit | 16d8031a0a2f592acd37efd60eaab2d3eb004422 (patch) | |
tree | 45df1aa3658fdb380ffd268eb3716b7c19d0631e | |
parent | ede314b07e68ad38a9ac74b4fb67e83efdc99d62 (diff) | |
download | mupdf-16d8031a0a2f592acd37efd60eaab2d3eb004422.tar.xz |
Paranoia check that paths begin with a moveto in stroking logic.
-rw-r--r-- | raster/pathstroke.c | 6 |
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) |