[fcmatch] Fix crash when no fonts are available.

This commit is contained in:
Behdad Esfahbod 2009-01-23 14:17:08 -05:00
parent c08216c6f4
commit b8860e2faf
1 changed files with 8 additions and 2 deletions

View File

@ -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 {