From 29638467c702fd528327da34cf6d96cf9dbf486a Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 17 Jul 2011 18:38:31 +0200 Subject: Hack: return a valid face index even if no glyph is found Temporary fix for a crash when a font face doesn't actually contain the glyph that fontconfig reports. Needs a real solution. --- libass/ass_font.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libass/ass_font.c b/libass/ass_font.c index 370623d..169de8d 100644 --- a/libass/ass_font.c +++ b/libass/ass_font.c @@ -487,6 +487,8 @@ int ass_font_get_index(void *fcpriv, ASS_Font *font, uint32_t symbol, } } #endif + // FIXME: make sure we have a valid face_index. this is a HACK. + *face_index = FFMAX(*face_index, 0); *glyph_index = index; return 1; -- cgit v1.2.3