diff options
Diffstat (limited to 'src/cairo-hull.c')
-rw-r--r-- | src/cairo-hull.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-hull.c b/src/cairo-hull.c index 008ba7f..1fa919b 100644 --- a/src/cairo-hull.c +++ b/src/cairo-hull.c @@ -198,9 +198,12 @@ _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices) cairo_hull_t *hull; int num_hull = *num_vertices; + if (CAIRO_INJECT_FAULT ()) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + if (num_hull > ARRAY_LENGTH (hull_stack)) { hull = _cairo_malloc_ab (num_hull, sizeof (cairo_hull_t)); - if (hull == NULL) + if (unlikely (hull == NULL)) return _cairo_error (CAIRO_STATUS_NO_MEMORY); } else { hull = hull_stack; |