Bug 44859

Summary: Invalid assertion statement in causes an application to fail
Product: cairo Reporter: crusnik <flareonenator>
Component: freetype font backendAssignee: David Turner <david>
Status: RESOLVED DUPLICATE QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.8.6   
Hardware: ARM   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description crusnik 2012-01-17 05:24:54 UTC
In the _cairo_ft_unscaled_font_lock_face, the following assertion code is invalid:


    /* If this unscaled font was created from an FT_Face then we just
     * returned it above. */
    assert (!unscaled->from_face);

When  _font_map_release_face_lock_held (font_map, entry) is called further below in the function, it sets unscaled->face to NULL, but unscaled->from_face remains true.

So when a call to _cairo_ft_unscaled_font_lock_face is made again for the released scaled face, it leads to an assertion failure, because 

if (unscaled->face)
        return unscaled->face;

does not return (unscaled->face is now NULL), while unscaled->from_face is true. This leads to an assertion failure.
Comment 1 crusnik 2012-01-17 20:28:39 UTC
I just tested the use case on the latest version of Cairo, and I see that the error does not occur. 

It looks like this fixed it: https://bugs.freedesktop.org/show_bug.cgi?id=18862

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

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.