diff options
author | Patrick Lam <plam@MIT.EDU> | 2005-11-29 00:21:05 +0000 |
---|---|---|
committer | Patrick Lam <plam@MIT.EDU> | 2005-11-29 00:21:05 +0000 |
commit | e0421d0289ae95a1c74e607f36c0d54f3d0dedd8 (patch) | |
tree | 6ca3ae26d487fec9f28d29f10f0305e207e77537 | |
parent | c4d3b6dad0ccb9b3ddfddb7305b4da26f494271d (diff) |
Fix segfault.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/fccfg.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -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 */ |