From be126b6842e979dbcb306b2f9f41a2114a149b9a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 5 Jan 2008 19:22:57 +0000 Subject: [PATCH] [cairo-analysis-surface] Check for an empty transformed bbox. After transforming the bbox, check that it has not been projected into an empty box. --- src/cairo-analysis-surface.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c index 1276a3540..b4213b240 100644 --- a/src/cairo-analysis-surface.c +++ b/src/cairo-analysis-surface.c @@ -115,8 +115,14 @@ _cairo_analysis_surface_add_operation (cairo_analysis_surface_t *surface, NULL); rect->x = floor (x1); rect->y = floor (x2); - rect->width = ceil (x2) - rect->x; - rect->height = ceil (y2) - rect->y; + + x2 = ceil (x2) - rect->x; + y2 = ceil (y2) - rect->y; + if (x2 <= 0 || y2 <= 0) + return CAIRO_STATUS_SUCCESS; + + rect->width = x2; + rect->height = y2; } bbox.p1.x = _cairo_fixed_from_int (rect->x);