gfx/cairo/zero-sized.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/cairo/zero-sized.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
     1.5 +index e9e544d..cde68a1 100644
     1.6 +--- a/src/cairo-image-surface.c
     1.7 ++++ b/src/cairo-image-surface.c
     1.8 +@@ -324,8 +324,8 @@ _cairo_image_surface_create_with_pixman_format (unsigned char		*data,
     1.9 +     cairo_surface_t *surface;
    1.10 +     pixman_image_t *pixman_image;
    1.11 + 
    1.12 +-    pixman_image = pixman_image_create_bits (pixman_format, width, height,
    1.13 +-					     (uint32_t *) data, stride);
    1.14 ++    pixman_image = pixman_image_create_bits (pixman_format, width ? width : 1, height ? height : 1,
    1.15 ++					     (uint32_t *) data, stride ? stride : 4);
    1.16 + 
    1.17 +     if (unlikely (pixman_image == NULL))
    1.18 + 	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
    1.19 +diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
    1.20 +index f86a133..ddcb600 100644
    1.21 +--- a/src/cairo-xlib-surface.c
    1.22 ++++ b/src/cairo-xlib-surface.c
    1.23 +@@ -675,7 +675,8 @@ _get_image_surface (cairo_xlib_surface_t    *surface,
    1.24 + 
    1.25 + 	pixmap = XCreatePixmap (surface->dpy,
    1.26 + 				surface->drawable,
    1.27 +-				extents.width, extents.height,
    1.28 ++				extents.width <= 0 ? 1 : extents.width,
    1.29 ++				extents.height <= 0 ? 1 : extents.height,
    1.30 + 				surface->depth);
    1.31 + 	if (pixmap) {
    1.32 + 	    XCopyArea (surface->dpy, surface->drawable, pixmap, surface->gc,
    1.33 +@@ -686,7 +687,8 @@ _get_image_surface (cairo_xlib_surface_t    *surface,
    1.34 + 	    ximage = XGetImage (surface->dpy,
    1.35 + 				pixmap,
    1.36 + 				0, 0,
    1.37 +-				extents.width, extents.height,
    1.38 ++				extents.width <= 0 ? 1 : extents.width,
    1.39 ++				extents.height <= 0 ? 1 : extents.height,
    1.40 + 				AllPlanes, ZPixmap);
    1.41 + 
    1.42 + 	    XFreePixmap (surface->dpy, pixmap);

mercurial