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

Chris Wilson ickle at kemper.freedesktop.org
Tue Feb 19 01:56:00 PST 2013


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

New commits:
commit e7e1ac235ff94d184d88c8c206b81343822f6a4e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 19 09:54:24 2013 +0000

    image: Compare against the true size of the embedded buffer
    
    When querying whether the run is small enough to fit inside the
    pre-allocated temporary buffer, we need to avoid comparing against
    sizeof(buf) as buf is a variable length array and so sizeof() is
    meaningless.
    
    Reported-by: Edward Zimmermann <Edward.Zimmermann at cib.de>
    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 be3db98..19372be 100644
--- a/src/cairo-image-compositor.c
+++ b/src/cairo-image-compositor.c
@@ -2993,7 +2993,7 @@ span_renderer_init (cairo_abstract_span_renderer_t	*_r,
 
     r->u.mask.extents = composite->unbounded;
     r->u.mask.stride = (r->u.mask.extents.width + 3) & ~3;
-    if (r->u.mask.extents.height * r->u.mask.stride > (int)sizeof (r->_buf)) {
+    if (r->u.mask.extents.height * r->u.mask.stride > SZ_BUF) {
 	r->mask = pixman_image_create_bits (PIXMAN_a8,
 					    r->u.mask.extents.width,
 					    r->u.mask.extents.height,


More information about the cairo-commit mailing list