[cairo-commit] src/cairo-ft-font.c

Bryce Harrington bryce at kemper.freedesktop.org
Wed Jan 24 04:07:02 UTC 2018


 src/cairo-ft-font.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 1cbebafe89610329a252b4cc076cd2dccf6e56aa
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Tue Jan 23 19:47:57 2018 -0800

    font: Check return value from _cairo_ft_unscaled_font_lock_face
    
    cairo-ft-font.c: In function ‘_cairo_ft_has_color_glyphs’:
    cairo-ft-font.c:3011:9: warning: ignoring return value of ‘_cairo_ft_unscaled_font_lock_face’, declared with attribute warn_unused_result [-Wunused-result]
             _cairo_ft_unscaled_font_lock_face (unscaled);
             ^

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 1f726bc2a..3c911cf39 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -3008,8 +3008,11 @@ _cairo_ft_has_color_glyphs (void *scaled)
     cairo_ft_unscaled_font_t *unscaled = ((cairo_ft_scaled_font_t *)scaled)->unscaled;
 
     if (!unscaled->have_color_set) {
-        _cairo_ft_unscaled_font_lock_face (unscaled);
-        _cairo_ft_unscaled_font_unlock_face (unscaled);
+	FT_Face face;
+	face = _cairo_ft_unscaled_font_lock_face (unscaled);
+	if (unlikely (face == NULL))
+	    return FALSE;
+	_cairo_ft_unscaled_font_unlock_face (unscaled);
     }
 
     return unscaled->have_color;


More information about the cairo-commit mailing list