Commit 592f40d6 authored by Ilkka Ollakka's avatar Ilkka Ollakka

freetype: initialise fontresult to FcResultMatch

fontconfig doesn't really seem to set that result variable correctly
in allmost all cases, only few codepaths that it's setted to NoMatch,
but it doesn't get setted on valid paths or configerrors or any of
thosecases. Thanks to Laurent Aimar for this one.
parent 2bffade0
......@@ -298,7 +298,9 @@ static int Create( vlc_object_t *p_this )
#ifdef HAVE_FONTCONFIG
FcPattern *fontpattern = NULL, *fontmatch = NULL;
FcResult fontresult = FcResultNoMatch;
/* Initialise result to Match, as fontconfig doesnt
* really set this other than some error-cases */
FcResult fontresult = FcResultMatch;
#endif
......@@ -362,6 +364,9 @@ static int Create( vlc_object_t *p_this )
goto error;
FcDefaultSubstitute( fontpattern );
/* testing fontresult here doesn't do any good really, but maybe it will
* in future as fontconfig code doesn't set it in all cases and just
* returns NULL or doesn't set to to Match on all Match cases.*/
fontmatch = FcFontMatch( NULL, fontpattern, &fontresult );
if( !fontmatch || fontresult == FcResultNoMatch )
goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment