Bug 4163

Summary: Segmentation-fault when rendering empty line with italic font
Product: cairo Reporter: Mathias Hasselmann <mathias.hasselmann>
Component: freetype font backendAssignee: Owen Taylor <otaylor>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: critical    
Priority: high    
Version: 0.9.3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Backtrace of the crash.
The offending code.
The bugfix suggested by Owen

Description Mathias Hasselmann 2005-08-20 16:47:19 UTC
Detected by playing with the Cairo backend of Pango: Cairo crashes in
_cairo_pattern_init_for_surface called from
_cairo_ft_unscaled_font_create_glyph, when rendering empty lines with some
italic font.

Crash disappears when assigning a language to the pango context.

Fix is a one-liner accordingly to Owen:

    if (unscaled->have_shape &&
	(unscaled->face->face_flags & FT_FACE_FLAG_SCALABLE) == 0)
	status = _transform_glyph_bitmap (val);

in _cairo_ft_unscaled_font_create_glyph needs a "&& val->image".
Comment 1 Mathias Hasselmann 2005-08-20 16:48:49 UTC
Created attachment 2946 [details]
Backtrace of the crash.
Comment 2 Mathias Hasselmann 2005-08-20 16:49:23 UTC
Created attachment 2947 [details]
The offending code.
Comment 3 Mathias Hasselmann 2005-08-20 16:55:08 UTC
Created attachment 2948 [details] [review]
The bugfix suggested by Owen
Comment 4 Mathias Hasselmann 2005-08-21 03:05:30 UTC
Forget to mention: Your bugfix works for me.
Comment 5 Owen Taylor 2005-08-21 08:06:20 UTC
2005-08-21  Owen Taylor  <otaylor@redhat.com>

        * src/cairo-ft-font.c (_cairo_ft_unscaled_font_create_glyph):
        Don't try to transform val->image when it is NULL.
        (#4163, Mathias Hasselmann)
Comment 6 Carl Worth 2005-08-22 17:15:06 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.

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.