]> git.wh0rd.org Git - fontconfig.git/commitdiff
Fix segfault.
authorPatrick Lam <plam@MIT.EDU>
Tue, 29 Nov 2005 00:21:05 +0000 (00:21 +0000)
committerPatrick Lam <plam@MIT.EDU>
Tue, 29 Nov 2005 00:21:05 +0000 (00:21 +0000)
ChangeLog
src/fccfg.c

index 812bff303749bfcbf7792f52207cecf3a77222ec..e41b48416b32b6dc1f7a06526759e275b58d346c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-28  Patrick Lam  <plam@mit.edu>
+       * src/fccfg.c (FcConfigBuildFonts):
+
+       Fix segfault.
+
 2005-11-28  Patrick Lam  <plam@mit.edu>
        * src/fcint.h:
        * src/fcpat.c (FcPatternFindFullFname):
index 3ba1ae915cc2f95ba87e5e099040bf5e6b78cae3..f021979629e65874aa57092dc321a8f850a52968 100644 (file)
@@ -308,8 +308,11 @@ FcConfigBuildFonts (FcConfig *config)
 
        for (i = 0; i < cached_fonts->nfont; i++)
        {
+            const char * cfn = (FcChar8 *)FcPatternFindFullFname
+                (cached_fonts->fonts[i]);
+
            if (FcConfigAcceptFont (config, cached_fonts->fonts[i]) &&
-                FcConfigAcceptFilename (config, (FcChar8 *)FcPatternFindFullFname(cached_fonts->fonts[i])))
+                (cfn && FcConfigAcceptFilename (config, cfn)))
                FcFontSetAdd (fonts, cached_fonts->fonts[i]);
 
            cached_fonts->fonts[i] = 0; /* prevent free in FcFontSetDestroy */