From: wm4 Date: Thu, 27 Aug 2015 18:46:11 +0000 (+0200) Subject: fontselect: check fontprovider constructors for failure X-Git-Tag: 0.13.0~28^2~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=038250b6bf4bb9a2b6d545f5f0a74b327302ca8b;p=libass fontselect: check fontprovider constructors for failure Should fix the DirectWrite to Fontconfig fallback. --- diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index 1eae986..a15d0de 100644 --- a/libass/ass_fontselect.c +++ b/libass/ass_fontselect.c @@ -911,16 +911,16 @@ ass_fontselect_init(ASS_Library *library, } if (dfp >= ASS_FONTPROVIDER_AUTODETECT) { - int found = 0; - for (int i = 0; !found && font_constructors[i].constructor; i++ ) + for (int i = 0; font_constructors[i].constructor; i++ ) if (dfp == font_constructors[i].id || dfp == ASS_FONTPROVIDER_AUTODETECT) { priv->default_provider = font_constructors[i].constructor(library, priv, config); - found = 1; + if (priv->default_provider) + break; } - if (!found) + if (!priv->default_provider) ass_msg(library, MSGL_WARN, "can't find selected font provider"); }