From 63aa7f735d806021b991514d55f894ac3df71d00 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Thu, 18 Aug 2011 06:36:15 +0200 Subject: 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. --- libass/ass_fontselect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3