[pango/font-format-crash] fc: Be robust against missing format information



commit b8ea73664563bd6c83ce4684402c62e10942981e
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 24 22:22:55 2019 -0400

    fc: Be robust against missing format information
    
    Some people have been seeing this assertion getting
    hit. So don't assert, simply skip fonts that don't
    have format information.
    
    Fixes: https://gitlab.gnome.org/GNOME/pango/issues/431

 pango/pangofc-fontmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index c7193941..2df9d16c 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -835,8 +835,7 @@ filter_fontset_by_format (FcFontSet *fontset)
       const char *s;
 
       res = FcPatternGetString (fontset->fonts[i], FC_FONTFORMAT, 0, (FcChar8 **)(void*)&s);
-      g_assert (res == FcResultMatch);
-      if (pango_fc_is_supported_font_format (s))
+      if (res == FcResultMatch && pango_fc_is_supported_font_format (s))
         FcFontSetAdd (result, FcPatternDuplicate (fontset->fonts[i]));
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]