commit 6d495296405feee97abd583deaaba036d7b16865 Author: Chris Wilson Date: Wed Sep 5 08:07:41 2007 +0100 [cairo-ft-font] Early detection of a zero sized bitmap. Under rare circumstances we may need to extract a surface that represents a bitmap with width==0 and rows==0. Detect this case at the start and simply return a zero-sized surface. diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index 201d1ad..8136502 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -735,6 +735,12 @@ _get_bitmap_surface (FT_Bitmap *bitmap, width = bitmap->width; height = bitmap->rows; + if (width == 0 || height == 0) { + *surface = (cairo_image_surface_t *) + cairo_image_surface_create_for_data (NULL, format, 0, 0, 0); + return (*surface)->base.status; + } + switch (bitmap->pixel_mode) { case FT_PIXEL_MODE_MONO: stride = (((width + 31) & ~31) >> 3);