Bug 8398 - segfaults in _cairo_xlib_surface_add_glyph
Summary: segfaults in _cairo_xlib_surface_add_glyph
Status: RESOLVED DUPLICATE of bug 7953
Alias: None
Product: cairo
Classification: Unclassified
Component: xlib backend (show other bugs)
Version: 1.2.4
Hardware: Other OpenBSD
: high major
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-22 10:22 UTC by Marc Brockschmidt
Modified: 2006-09-22 10:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch fir #8398 (444 bytes, patch)
2006-09-22 10:23 UTC, Marc Brockschmidt
Details | Splinter Review

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.