From f63dbaddb6de6add6d987dc28ca8771aca230451 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Thu, 17 May 2012 17:38:00 +0300 Subject: font_load_ft.c: fix possible crash with recent Fontconfig Calling FcFontMatch with last argument NULL triggers an assertion failure in latest libfontconfig (2.9.0). Change the code to use a dummy address, like another nearby call to FcFontMatch already did. Whether the code triggering the assertion failure was run depended on font settings and/or available system fonts (the code looks like you'd have to get a non-scalable font first). Thus it didn't usually happen even with problematic libfontconfig version. --- sub/font_load_ft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sub') diff --git a/sub/font_load_ft.c b/sub/font_load_ft.c index a501cfc750..eb6d70b657 100644 --- a/sub/font_load_ft.c +++ b/sub/font_load_ft.c @@ -1160,7 +1160,7 @@ void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_n FcConfigSubstitute(0, fc_pattern, FcMatchPattern); FcDefaultSubstitute(fc_pattern); fc_pattern2 = fc_pattern; - fc_pattern = FcFontMatch(0, fc_pattern, 0); + fc_pattern = FcFontMatch(0, fc_pattern, &result); FcPatternDestroy(fc_pattern2); } // s doesn't need to be freed according to fontconfig docs -- cgit v1.2.3