summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_font.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libass/ass_font.c b/libass/ass_font.c
index 1ae136bc1e..285ecde63a 100644
--- a/libass/ass_font.c
+++ b/libass/ass_font.c
@@ -47,9 +47,19 @@ static void charmap_magic(FT_Face face)
unsigned eid = cmap->encoding_id;
if (pid == 3 /*microsoft*/ && (eid == 1 /*unicode bmp*/ || eid == 10 /*full unicode*/)) {
FT_Set_Charmap(face, cmap);
- break;
+ return;
}
}
+
+ if (!face->charmap) {
+ if (face->num_charmaps == 0) {
+ mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_NoCharmaps);
+ return;
+ }
+ mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_NoCharmapAutodetected);
+ FT_Set_Charmap(face, face->charmaps[0]);
+ return;
+ }
}
/**