Bug 91321

Summary: Incorrect sizeof expression
Product: cairo Reporter: Arpit <jain.arpit>
Component: gl backendAssignee: Arpit <jain.arpit>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Arpit 2015-07-13 05:23:11 UTC
In src/cairo-gl-composite.c 

At _cairo_gl_composite_flush function:

     for (i = 0; i < ARRAY_LENGTH (&ctx->glyph_cache); i++)
         _cairo_gl_glyph_cache_unlock (&ctx->glyph_cache[i]);


The sizeof operator was applied to an unintended variable.
It is applied to a pointer variable "ARRAY_LENGTH (&ctx->glyph_cache)" instead of its target "ctx->glyph_cache".
Comment 1 Arpit 2015-07-13 06:04:27 UTC
The patch for this Bug is submitted.
and the link for the patch is as follows:

http://lists.freedesktop.org/archives/cairo/2015-July/026381.html
Comment 2 Bryce Harrington 2015-07-30 21:15:46 UTC
commit edd321c2f52daaef9804481bc4d0aa84f8ff0060
Author:     Arpit Jain <jain.arpit@samsung.com>
AuthorDate: Mon Jul 13 11:31:48 2015 +0530
Commit:     Bryce Harrington <bryce@osg.samsung.com>
CommitDate: Tue Jul 14 01:44:33 2015 -0700

    gl: Fix incorrect size of expression

    The sizeof operator now applied to the correct variable "ctx->glyph_cache",
    instead of its pointer address, in function "_cairo_gl_composite_flush".

    Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=91321
    Signed-off-by: Arpit Jain <jain.arpit@samsung.com>
    Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.