summaryrefslogtreecommitdiff
path: root/src/cairo-pen.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-09-21 15:17:59 -0700
committerCarl Worth <cworth@cworth.org>2006-10-18 15:02:12 -0700
commit10cd23d51fbfc99d6e3e401440eebb56df3b3327 (patch)
treefc19d9b5e0134ddec9c47df69d9aad81373557fd /src/cairo-pen.c
parent5b7a7f39ad8b726e9ee582bcd10500a1e5b16554 (diff)
downloadcairo-10cd23d51fbfc99d6e3e401440eebb56df3b3327.tar.gz
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.
Diffstat (limited to 'src/cairo-pen.c')
-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;
}