[cairo-commit] src/cairo-xlib-source.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Jan 13 14:50:15 PST 2013


 src/cairo-xlib-source.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6639c1231072d71d33eb0952bae5f95e7480cd0d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jan 13 22:48:30 2013 +0000

    xlib: Initialise Pixmap for proxy sources
    
    So that we do not try to tell X to free a garbage pixmap and promptly
    kill us.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
index d0d6c0e..24290f7 100644
--- a/src/cairo-xlib-source.c
+++ b/src/cairo-xlib-source.c
@@ -109,7 +109,7 @@ source (cairo_xlib_surface_t *dst, Picture picture, Pixmap pixmap)
     if (picture == None)
 	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
 
-    source = malloc (sizeof (cairo_image_surface_t));
+    source = malloc (sizeof (*source));
     if (unlikely (source == NULL)) {
 	XRenderFreePicture (dst->display->display, picture);
 	if (pixmap)
@@ -973,6 +973,7 @@ surface_source (cairo_xlib_surface_t *dst,
 						      _cairo_xlib_shm_surface_get_pixmap (src),
 						      _cairo_xlib_shm_surface_get_xrender_format (src),
 						      0, NULL);
+	proxy->source.pixmap = None;
 
 	proxy->source.has_component_alpha = 0;
 	proxy->source.has_matrix = 0;


More information about the cairo-commit mailing list