From 038250b6bf4bb9a2b6d545f5f0a74b327302ca8b Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 27 Aug 2015 20:46:11 +0200 Subject: fontselect: check fontprovider constructors for failure Should fix the DirectWrite to Fontconfig fallback. --- libass/ass_fontselect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libass/ass_fontselect.c') 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"); } -- cgit v1.2.3