[cairo-commit] src/cairo-image-compositor.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Mar 22 17:35:25 PDT 2012


 src/cairo-image-compositor.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 8a65d8e2de7d26bf285953a327b24a667eee62da
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Mar 23 00:31:58 2012 +0000

    image: Fix leak of white solid color for masked composition of CLEAR
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
index 990226a..6b95840 100644
--- a/src/cairo-image-compositor.c
+++ b/src/cairo-image-compositor.c
@@ -480,6 +480,7 @@ composite_boxes (void			*_dst,
     pixman_image_t *dst = to_pixman_image (_dst);
     pixman_image_t *src = ((cairo_image_source_t *)abstract_src)->pixman_image;
     pixman_image_t *mask = abstract_mask ? ((cairo_image_source_t *)abstract_mask)->pixman_image : NULL;
+    pixman_image_t *free_src = NULL;
     struct _cairo_boxes_chunk *chunk;
     int i;
 
@@ -496,7 +497,7 @@ composite_boxes (void			*_dst,
 #if PIXMAN_HAS_OP_LERP
 	    op = PIXMAN_OP_LERP_CLEAR;
 #else
-	    src = _pixman_image_for_color (CAIRO_COLOR_WHITE);
+	    free_src = src = _pixman_image_for_color (CAIRO_COLOR_WHITE);
 	    op = PIXMAN_OP_OUT_REVERSE;
 #endif
 	} else if (op == CAIRO_OPERATOR_SOURCE) {
@@ -527,6 +528,9 @@ composite_boxes (void			*_dst,
 	}
     }
 
+    if (free_src)
+	pixman_image_unref (free_src);
+
     return CAIRO_STATUS_SUCCESS;
 }
 


More information about the cairo-commit mailing list