From 3ab9ca54aa490438dbbfae7b5f1cde0bd98352cd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 5 Mar 2007 16:33:46 -0500 Subject: [PATCH] In cairo_text_path(), bail out if zero glyphs --- src/cairo.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cairo.c b/src/cairo.c index de3eb74a0..355fcaecf 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -2904,12 +2904,11 @@ cairo_text_path (cairo_t *cr, const char *utf8) x, y, &glyphs, &num_glyphs); - if (cr->status) { - if (glyphs) - free (glyphs); - _cairo_set_error (cr, cr->status); + if (cr->status) + goto BAIL; + + if (num_glyphs == 0) return; - } cr->status = _cairo_gstate_glyph_path (cr->gstate, glyphs, num_glyphs,