Bug 8398

Summary: segfaults in _cairo_xlib_surface_add_glyph
Product: cairo Reporter: Marc Brockschmidt <he>
Component: xlib backendAssignee: Carl Worth <cworth>
Status: RESOLVED DUPLICATE QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: major    
Priority: high    
Version: 1.2.4   
Hardware: Other   
OS: OpenBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch fir #8398

Description Marc Brockschmidt 2006-09-22 10:22:14 UTC
Heya,

Due to a programming error, _cairo_xlib_surface_add_glyph segfaults in some
(all?) cases on OpenBSD/X.org 6.8. Patch:

--- src/cairo-xlib-surface.c.orig       Fri Aug 18 16:20:16 2006
+++ src/cairo-xlib-surface.c    Fri Sep 22 12:10:29 2006
@@ -2439,7 +2439,7 @@
        break;
     case CAIRO_FORMAT_ARGB32:
        if (_native_byte_order_lsb() != (ImageByteOrder (dpy) == LSBFirst)) {
-           unsigned int    c = glyph_surface->stride * glyph_surface->height;
+           int    c = glyph_surface->stride * glyph_surface->height;
            unsigned char   *d;
            unsigned char   *new, *n;

Later on, the same 'c' was used for a "while ((c -= 4) >= 0)" loop, which lead
to, eh, "interesting" results.
Comment 1 Marc Brockschmidt 2006-09-22 10:23:36 UTC
Created attachment 7120 [details] [review]
Patch fir #8398

Same patch as in the bug report, but attached to avoid whitespace fuckups.
Comment 2 Behdad Esfahbod 2006-09-22 10:46:48 UTC
This has been already fixed.   I'll try to get a new release out soon.

*** This bug has been marked as a duplicate of 7953 ***

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.