[Originally posted here: http://lists.freedesktop.org/archives/cairo/2006-January/006207.html] If a bitmap font has a 0x0 glyphs, the current cairo-ft-font.c:_get_bitmap_surface returns a NULL surface: - if (width * height == 0) { - if (own_buffer && bitmap->buffer) - free (bitmap->buffer); - - *surface = NULL; - } else { which indeed crashes in the calling function immediately. So I first fixed that by fixing the calling function. This is the first patch attached. But seems like (at least) the xlib backend expects non-NULL glyph surfaces: (gdb) f 0 #0 0x00477e66 in _cairo_xlib_surface_add_glyph (dpy=0x9ef1878, scaled_font=0xa1d0238, scaled_glyph=0xa1d4518) at cairo-xlib-surface.c:2121 2121 glyph_info.x = -(int) glyph_surface->base.device_x_offset; So I backed up and removed the special case for 0x0 glyphs. Everything seems to be fine now. That's the second patch attached. I think it can be committed (with some format change maybe), as 0x0 glyphs are not common enough to try to save a 0x0 surface for them... Both patches fix another problem, _render_glyph_bitmap should check the status returned by _get_bitmap_surface.
Created attachment 4477 [details] [review] patch 1
Created attachment 4478 [details] [review] patch 2
*** Bug 5433 has been marked as a duplicate of this bug. ***
This caused my gedit 2.13 to crash, the second patch fixed things fine. Love, Karderio
The second patch (with appropriate formatting fixes) has been committed to cairo's central (git-maintained) tree: commit 57edf3f28fa09d2ec24d85dcc91a220d901a4452 Author: Carl Worth <cworth@raht.cworth.org> Date: Thu Feb 16 09:05:52 2006 -0800 Normalize indentation after previous commit. commit 0152bd3a562442853ab930eaea316c08b34f6ba6 Author: Carl Worth <cworth@raht.cworth.org> Date: Thu Feb 16 09:02:29 2006 -0800 Allow _get_bitmap_surface to work for 0x0 glyphs, (fix for bug #5734). Patch from: Behdad Esfahbod <freedesktop@behdad.org> Reviewed by: Carl Worth <cworth@cworth.org>
*** Bug 5821 has been marked as a duplicate of this bug. ***
*** Bug 4800 has been marked as a duplicate of this bug. ***
So how exactly does the numbering convention work here ? From bug 4800 we're told that the bug is fixed in version 1.0.4 of git, whereas i pull from cvs and the last version was 1.1.1 % pkg-config --modversion cairo 1.1.1 So was there a reverse in versioning ? And why isn't cairo updates here http://cairographics.org/snapshots ? Confused...
Humm, it's a bit overcomplicated. 1.0.4 is a bug-fix release in the 1.0 series, while 1.1.1 is a CVS checkout of development between 1.0 and 1.2. So yes, 1.0.4 was released after your 1.1.1 checkout was made. That's how most of projects with separate stable and development branches work these days. The bug is also fixed in the development tree, but that has been moved to git and the CVS is not updated anymore.
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.