summaryrefslogtreecommitdiff
path: root/src/fccfg.c
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 /src/fccfg.c
parentc4d3b6dad0ccb9b3ddfddb7305b4da26f494271d (diff)
Fix segfault.
Diffstat (limited to 'src/fccfg.c')
-rw-r--r--src/fccfg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fccfg.c b/src/fccfg.c
index 3ba1ae9..f021979 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 */