summaryrefslogtreecommitdiff
path: root/src/cairo-spline.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2004-05-07 18:52:01 +0000
committerCarl Worth <cworth@cworth.org>2004-05-07 18:52:01 +0000
commit1e20a2db0fa26c6882bc00f8ea00cbf1e4619884 (patch)
treeddf310b0f8453c3f8910bb2ad1efb3865958eff3 /src/cairo-spline.c
parent9faef192afc6a1606518a8e6a0a8e4e27351d920 (diff)
downloadcairo-1e20a2db0fa26c6882bc00f8ea00cbf1e4619884.tar.gz
Bail on NULL utf8 string.
Don't add two consecutive, identical points when decomposing the spline, (which was leading to an infinte loop in the stroke algorithm when it found a slope of (0,0)).
Diffstat (limited to 'src/cairo-spline.c')
-rw-r--r--src/cairo-spline.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cairo-spline.c b/src/cairo-spline.c
index f05a9da55..6192f8636 100644
--- a/src/cairo-spline.c
+++ b/src/cairo-spline.c
@@ -118,6 +118,13 @@ static cairo_status_t
_cairo_spline_add_point (cairo_spline_t *spline, cairo_point_t *point)
{
cairo_status_t status;
+ cairo_point_t *prev;
+
+ if (spline->num_points) {
+ prev = &spline->points[spline->num_points - 1];
+ if (prev->x == point->x && prev->y == point->y)
+ return CAIRO_STATUS_SUCCESS;
+ }
if (spline->num_points >= spline->points_size) {
status = _cairo_spline_grow_by (spline, CAIRO_SPLINE_GROWTH_INC);