]> granicus.if.org Git - libass/commitdiff
Hack: return a valid face index even if no glyph is found
authorGrigori Goronzy <greg@blackbox>
Sun, 17 Jul 2011 16:38:31 +0000 (18:38 +0200)
committerGrigori Goronzy <greg@blackbox>
Sun, 17 Jul 2011 16:38:31 +0000 (18:38 +0200)
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

index 370623d20531b4f2c47f88627768d85adc6dfff1..169de8d8874e34c0d3c341dc75ab3e9c1cb69908 100644 (file)
@@ -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;