From 1237eedff3d557b94db9c940fd8de48be9ba41ba Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 8 Apr 2007 22:56:43 +0100 Subject: [PATCH] Check for error whilst trying to advance along a text string. The text perf-case tries to fill the region with a single text string, but fails to detect when the current point does not advance due to an error. This causes the perf-case to enter an infinite loop, so we break out when the cairo_status() has been set. --- perf/text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perf/text.c b/perf/text.c index de5e0cd8b..efe7d913e 100644 --- a/perf/text.c +++ b/perf/text.c @@ -40,14 +40,14 @@ do_text (cairo_t *cr, int width, int height) cairo_move_to (cr, 0, i * 10); cairo_show_text (cr, text + i); cairo_get_current_point (cr, &x, &y); - while (x < width) { + while (x < width && cairo_status (cr) == CAIRO_STATUS_SUCCESS) { cairo_show_text (cr, text); cairo_get_current_point (cr, &x, &y); } i++; if (i >= len) i = 0; - } while (y < height); + } while (y < height && cairo_status (cr) == CAIRO_STATUS_SUCCESS); cairo_perf_timer_stop ();