# HG changeset patch # User Kenichi Handa # Date 1232366852 0 # Node ID 4c2b48d0a379dd0ba60c951778c3e913f467cbd0 # Parent dc4bcae2bbbcf7af1bdb664b9c180174ebbcacf8 (ftfont_lookup_cache): Check the return value of FcFontList. (ftfont_list): Likewise. diff -r dc4bcae2bbbc -r 4c2b48d0a379 src/ftfont.c --- a/src/ftfont.c Mon Jan 19 06:52:50 2009 +0000 +++ b/src/ftfont.c Mon Jan 19 12:07:32 2009 +0000 @@ -310,9 +310,10 @@ FC_INDEX, FcTypeInteger, index, NULL); objset = FcObjectSetBuild (FC_CHARSET, NULL); fontset = FcFontList (NULL, pat, objset); - xassert (fontset && fontset->nfont > 0); - if (FcPatternGetCharSet (fontset->fonts[0], FC_CHARSET, 0, &charset) - == FcResultMatch) + if (fontset && fontset->nfont > 0 + && (FcPatternGetCharSet (fontset->fonts[0], FC_CHARSET, 0, + &charset) + == FcResultMatch)) cache_data->fc_charset = FcCharSetCopy (charset); else cache_data->fc_charset = FcCharSetCreate (); @@ -835,7 +836,7 @@ FcPatternAddString (pattern, FC_FAMILY, fam); FcFontSetDestroy (fontset); fontset = FcFontList (NULL, pattern, objset); - if (fontset->nfont > 0) + if (fontset && fontset->nfont > 0) break; } }