[cairo-commit] src/cairo-gl-operand.c

Chris Wilson ickle at kemper.freedesktop.org
Wed May 30 02:47:29 PDT 2012


 src/cairo-gl-operand.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9340fcd965dedf714f658c6ad441787d75c05e59
Author: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Date:   Wed May 30 15:13:46 2012 +0800

    gl: use _cairo_gl_operand_copy to fix unblanced reference count
    
    Use _cairo_gl_operand_copy to do the operand copy instead of by
    something like *operand = surface->operand.
    
    This would fix a crash introduced by operator-source test case, which
    forgot to do reference while copying operand but did dereference while
    destroying surface at combine_clip_as_traps().
    
    Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
    [ickle: drop the extra reference for the owned surface]
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index d3df95b..4ef3307 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -223,7 +223,7 @@ _cairo_gl_subsurface_operand_init (cairo_gl_operand_t *operand,
      * (unnormalized src -> unnormalized src) to
      * (unnormalized dst -> unnormalized src)
      */
-    *operand = surface->operand;
+    _cairo_gl_operand_copy(operand, &surface->operand);
 
     attributes = &operand->texture.attributes;
     attributes->matrix = src->base.matrix;
@@ -270,7 +270,7 @@ _cairo_gl_surface_operand_init (cairo_gl_operand_t *operand,
     if (unlikely (status))
 	return status;
 
-    *operand = surface->operand;
+    _cairo_gl_operand_copy(operand, &surface->operand);
 
     attributes = &operand->texture.attributes;
     cairo_matrix_multiply (&attributes->matrix,


More information about the cairo-commit mailing list