summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2011-08-18 06:36:15 +0200
committerGrigori Goronzy <greg@chown.ath.cx>2015-07-10 10:42:40 +0200
commit63aa7f735d806021b991514d55f894ac3df71d00 (patch)
tree150d7c902214e88ce13af01b437148cd444f1b18
parent3b72ae063fe2f4d7adb7c59587155e0a45c692d0 (diff)
downloadlibass-63aa7f735d806021b991514d55f894ac3df71d00.tar.bz2
libass-63aa7f735d806021b991514d55f894ac3df71d00.tar.xz
Don't match any font if there's no glyph coverage
Do not return a font face at all instead of using the last one. Fixes fallback to the default font path.
-rw-r--r--libass/ass_fontselect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c
index 04a6cb4..56d877e 100644
--- a/libass/ass_fontselect.c
+++ b/libass/ass_fontselect.c
@@ -340,7 +340,7 @@ static char *select_font(ASS_FontSelector *priv, ASS_Library *library,
font_info_compare);
// check glyph coverage
- while (idx < priv->n_font - 1) {
+ while (idx < priv->n_font) {
ASS_FontProvider *provider = font_infos[idx].provider;
if (!provider || !provider->funcs.check_glyph) {
idx++;
@@ -355,6 +355,8 @@ static char *select_font(ASS_FontSelector *priv, ASS_Library *library,
free(req.family);
// return best match
+ if (idx == priv->n_font)
+ return NULL;
if (!font_infos[idx].path)
return NULL;
*index = font_infos[idx].index;