From: Patrick Lam Date: Tue, 29 Nov 2005 00:21:05 +0000 (+0000) Subject: Fix segfault. X-Git-Tag: fc-2_3_93~17 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e0421d0289ae95a1c74e607f36c0d54f3d0dedd8;p=fontconfig.git Fix segfault. --- diff --git a/ChangeLog b/ChangeLog index 812bff3..e41b484 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-28 Patrick Lam + * src/fccfg.c (FcConfigBuildFonts): + + Fix segfault. + 2005-11-28 Patrick Lam * src/fcint.h: * src/fcpat.c (FcPatternFindFullFname): 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 */