From 3023330706b1237b0fbd697d015cad9a23c250b7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 10 Aug 2009 10:57:41 +0100 Subject: [fill] Early check for empty path/polygon --- src/cairo-path-fill.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cairo-path-fill.c') diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c index 50cd2183..0cad156c 100644 --- a/src/cairo-path-fill.c +++ b/src/cairo-path-fill.c @@ -156,6 +156,9 @@ _cairo_path_fixed_fill_to_traps (const cairo_path_fixed_t *path, cairo_polygon_t polygon; cairo_status_t status; + if (path->is_empty_fill) + return CAIRO_STATUS_SUCCESS; + _cairo_polygon_init (&polygon); if (traps->has_limits) _cairo_polygon_limit (&polygon, &traps->limits); @@ -163,7 +166,7 @@ _cairo_path_fixed_fill_to_traps (const cairo_path_fixed_t *path, status = _cairo_path_fixed_fill_to_polygon (path, tolerance, &polygon); - if (unlikely (status)) + if (unlikely (status || polygon.num_edges == 0)) goto CLEANUP; if (path->is_rectilinear) { -- cgit v1.2.3