summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-09-21 15:17:59 -0700
committerCarl Worth <cworth@cworth.org>2006-11-02 13:02:03 -0800
commitd0bca72499c7fc54ab2beff57b7985b56633f50b (patch)
treefd54512632fc95a659dbac973dbcdbcfca38967c
parent137ced1dd7a8d6a161be8f3b7e186cf60ce59d91 (diff)
Fix infinite-join test case (bug #8379)
The trick for this was to carefully ensure that the pen always has at least 4 vertices. There was a previous attempt at this in the code already but the test case had a combination of matrix and radius that resulted in a value that was just able to sneak past the previous check. (cherry picked from 10cd23d51fbfc99d6e3e401440eebb56df3b3327 commit)
-rw-r--r--src/cairo-pen.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cairo-pen.c b/src/cairo-pen.c
index 3d42314c9..0e24f2d70 100644
--- a/src/cairo-pen.c
+++ b/src/cairo-pen.c
@@ -270,7 +270,12 @@ _cairo_pen_vertices_needed (double tolerance,
/* number of vertices must be even */
if (num_vertices % 2)
num_vertices++;
+
+ /* And we must always have at least 4 vertices. */
+ if (num_vertices < 4)
+ num_vertices = 4;
}
+
return num_vertices;
}