summaryrefslogtreecommitdiffstats
path: root/libass/ass_fontselect.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-27 20:46:11 +0200
committerwm4 <wm4@nowhere>2015-08-28 14:06:50 +0200
commit038250b6bf4bb9a2b6d545f5f0a74b327302ca8b (patch)
treefdd7b4f01fcb50f47d45a8a542bf3f7bef5e8d53 /libass/ass_fontselect.c
parentcb1e749aa9ac421629cf8d443b7aac7dfdd2fe72 (diff)
downloadlibass-038250b6bf4bb9a2b6d545f5f0a74b327302ca8b.tar.bz2
libass-038250b6bf4bb9a2b6d545f5f0a74b327302ca8b.tar.xz
fontselect: check fontprovider constructors for failure
Should fix the DirectWrite to Fontconfig fallback.
Diffstat (limited to 'libass/ass_fontselect.c')
-rw-r--r--libass/ass_fontselect.c8
1 files changed, 4 insertions, 4 deletions
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");
}