]> git.eshelyaron.com Git - emacs.git/commitdiff
(ftfont_lookup_cache): Check the return value of FcFontList.
authorKenichi Handa <handa@m17n.org>
Mon, 19 Jan 2009 12:08:31 +0000 (12:08 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 19 Jan 2009 12:08:31 +0000 (12:08 +0000)
(ftfont_list): Likewise.

src/ChangeLog
src/ftfont.c

index 91714a8327373a1baf0168802fb765589fec8e86..0ba6e2f79b11c59f175065ed5a3c136d3bff5857 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-19  Kenichi Handa  <handa@m17n.org>
+
+       * ftfont.c (ftfont_lookup_cache): Check the return value of
+       FcFontList.
+       (ftfont_list): Likewise.
+
 2009-01-18  Juanma Barranquero  <lekktu@gmail.com>
 
        * dbusbind.c (Fdbus_register_signal):
index eb8893965be53608dedf3013f7f58b20ca0321cf..b28c4c3ea210cfc209d09df66f12ebe80b457ed6 100644 (file)
@@ -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;
            }
        }