summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2005-11-29 00:21:05 +0000
committerPatrick Lam <plam@MIT.EDU>2005-11-29 00:21:05 +0000
commite0421d0289ae95a1c74e607f36c0d54f3d0dedd8 (patch)
tree6ca3ae26d487fec9f28d29f10f0305e207e77537
parentc4d3b6dad0ccb9b3ddfddb7305b4da26f494271d (diff)
Fix segfault.
-rw-r--r--ChangeLog5
-rw-r--r--src/fccfg.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 812bff30..e41b4841 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
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):
* src/fccfg.c (FcConfigBuildFonts):
diff --git a/src/fccfg.c b/src/fccfg.c
index 3ba1ae91..f0219796 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -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 */