From e0421d0289ae95a1c74e607f36c0d54f3d0dedd8 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Tue, 29 Nov 2005 00:21:05 +0000 Subject: [PATCH] Fix segfault. --- ChangeLog | 5 +++++ src/fccfg.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 */ -- 2.39.5