From 7ca28c2fedb34c1db5ee3116d335f15195859db0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 18 Dec 2017 21:22:21 -0500 Subject: [PATCH 1/8] Don't crash Not proper fix necessarily. But fixes this crash: https://bugs.freedesktop.org/show_bug.cgi?id=101889#c81 --- src/fcmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcmatch.c b/src/fcmatch.c index 5d30cc7..95bb204 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -653,7 +653,7 @@ FcFontRenderPrepare (FcConfig *config, if (!l) goto bail0; dir = FcStrDirname (FcValueString (&l->value)); - if (FcHashTableFind (config->alias_table, dir, (void **) &alias)) + if (config && FcHashTableFind (config->alias_table, dir, (void **) &alias)) { FcChar8 *base = FcStrBasename (FcValueString (&l->value)); FcChar8 *s = FcStrBuildFilename (alias, base, NULL); -- 2.14.3 From aa85a2b3b6b652c079e895865e800e3d9b60a5f5 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Tue, 19 Dec 2017 12:16:48 +0900 Subject: [PATCH 3/8] Try to get current instance of FcConfig as far as possible --- src/fcmatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fcmatch.c b/src/fcmatch.c index 95bb204..f06d98a 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -653,6 +653,8 @@ FcFontRenderPrepare (FcConfig *config, if (!l) goto bail0; dir = FcStrDirname (FcValueString (&l->value)); + if (!config) + config = FcConfigGetCurrent (); if (config && FcHashTableFind (config->alias_table, dir, (void **) &alias)) { FcChar8 *base = FcStrBasename (FcValueString (&l->value)); -- 2.14.3