[cairo-commit] src/cairo-quartz-surface.c

Brian Ewins brianewins at kemper.freedesktop.org
Sat Nov 10 17:50:35 PST 2007


 src/cairo-quartz-surface.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2fd50a7897efaed4dabaf75a6ed8828f16c14d36
Author: Brian Ewins <Brian.Ewins at gmail.com>
Date:   Sun Nov 11 01:29:00 2007 +0000

    [quartz] handle 0x0 surfaces.
    
    Some tests, like invalid-matrix, generate a 0x0 bitmap; in
    the quartz backend this caused a nil surface to be returned,
    whereas the tests expect a quartz surface. Other surfaces
    return a backend-specific surface with a zero-sized bitmap,
    quartz should do the same.
    
    Fixes the tests ft-font-create-for-ft-face, get-and-set,
    get-clip, invalid-matrix, line-width-zero,
    select-font-no-show-text, solid-pattern-cache-stress,
    surface-finish-twice, and text-cache-crash.

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 508b8a3..76073f1 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -1882,7 +1882,7 @@ cairo_quartz_surface_create (cairo_format_t format,
     }
 
     imageData = _cairo_malloc_ab (height, stride);
-    if (!imageData) {
+    if (!imageData && stride > 0 && height > 0) {
 	CGColorSpaceRelease (cgColorspace);
 	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return (cairo_surface_t*) &_cairo_surface_nil;


More information about the cairo-commit mailing list