mirror of
https://github.com/mpv-player/mpv
synced 2025-03-04 21:27:58 +00:00
Check return value of add_face.
This fixes segfault when reselecting fonts and the new font could not be loaded (because of a bad font file, or too many font faces already loaded). Patch by Glen Nakamura, glen at imodulo dot com. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24855 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
1f5bb6386e
commit
c0eaa90799
@ -294,12 +294,14 @@ FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch
|
||||
mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_GlyphNotFoundReselectingFont,
|
||||
ch, font->desc.family, font->desc.bold, font->desc.italic);
|
||||
face_idx = add_face(fontconfig_priv, font, ch);
|
||||
if (face_idx >= 0) {
|
||||
face = font->faces[face_idx];
|
||||
index = FT_Get_Char_Index(face, ch);
|
||||
if (index == 0) {
|
||||
mp_msg(MSGT_ASS, MSGL_ERR, MSGTR_LIBASS_GlyphNotFound,
|
||||
ch, font->desc.family, font->desc.bold, font->desc.italic);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user