diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-01-23 14:17:08 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-02-15 13:40:17 -0800 |
commit | b8860e2faffa8b3f62b3c7aafd2d3b6962566f41 (patch) | |
tree | af0422b2350acd234aacf673701697cb54b6594b /src | |
parent | c08216c6f468ce22cb7c0c1959019a7caad3484a (diff) |
[fcmatch] Fix crash when no fonts are available.
Diffstat (limited to 'src')
-rw-r--r-- | src/fcmatch.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 { |