From: Kenichi Handa Date: Mon, 19 Jan 2009 12:08:31 +0000 (+0000) Subject: (ftfont_lookup_cache): Check the return value of FcFontList. X-Git-Tag: emacs-pretest-23.0.90~377 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1c0db158ed038b24031ad0b15ba098a1be10a53c;p=emacs.git (ftfont_lookup_cache): Check the return value of FcFontList. (ftfont_list): Likewise. --- diff --git a/src/ChangeLog b/src/ChangeLog index 91714a83273..0ba6e2f79b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2009-01-19 Kenichi Handa + + * ftfont.c (ftfont_lookup_cache): Check the return value of + FcFontList. + (ftfont_list): Likewise. + 2009-01-18 Juanma Barranquero * dbusbind.c (Fdbus_register_signal): diff --git a/src/ftfont.c b/src/ftfont.c index eb8893965be..b28c4c3ea21 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -310,9 +310,10 @@ ftfont_lookup_cache (key, for_face) 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 @@ ftfont_list (frame, spec) FcPatternAddString (pattern, FC_FAMILY, fam); FcFontSetDestroy (fontset); fontset = FcFontList (NULL, pattern, objset); - if (fontset->nfont > 0) + if (fontset && fontset->nfont > 0) break; } }