diff options
Diffstat (limited to 'libass')
-rw-r--r-- | libass/ass_fontselect.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index 04a6cb4d..56d877e6 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; |