From 10cd23d51fbfc99d6e3e401440eebb56df3b3327 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 21 Sep 2006 15:17:59 -0700 Subject: [PATCH] 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. --- src/cairo-pen.c | 5 +++++ 1 file changed, 5 insertions(+) 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; }