From: Behdad Esfahbod Date: Fri, 23 Jan 2009 19:17:08 +0000 (-0500) Subject: [fcmatch] Fix crash when no fonts are available. X-Git-Tag: 2.7.0~127 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b8860e2faffa8b3f62b3c7aafd2d3b6962566f41;p=fontconfig.git [fcmatch] Fix crash when no fonts are available. --- diff --git a/src/fcmatch.c b/src/fcmatch.c index 556fffe..b86cbbc 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -550,7 +550,10 @@ FcFontSetMatch (FcConfig *config, return 0; } best = FcFontSetMatchInternal (config, sets, nsets, p, result); - return FcFontRenderPrepare (config, p, best); + if (best) + return FcFontRenderPrepare (config, p, best); + else + return NULL; } FcPattern * @@ -575,7 +578,10 @@ FcFontMatch (FcConfig *config, sets[nsets++] = config->fonts[FcSetApplication]; best = FcFontSetMatchInternal (config, sets, nsets, p, result); - return FcFontRenderPrepare (config, p, best); + if (best) + return FcFontRenderPrepare (config, p, best); + else + return NULL; } typedef struct _FcSortNode {