]> granicus.if.org Git - libass/commitdiff
Ignoring FT_Glyph_Stroke() errors can potentially lead to double free().
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 10 Jul 2006 23:57:17 +0000 (23:57 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 10 Jul 2006 23:57:17 +0000 (23:57 +0000)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19007 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_render.c

index 17233948304aff980bf28edb5d55edba24d7d2a1..a34b653878ed56d47dab067d3ed023aa87cae26e 100644 (file)
@@ -1120,7 +1120,11 @@ static int get_glyph(int index, int symbol, glyph_info_t* info, FT_Vector* advan
        info->advance.y = info->glyph->advance.y >> 10;
 
        info->outline_glyph = info->glyph;
-       FT_Glyph_Stroke( &(info->outline_glyph), render_context.stroker, 0 ); // don't destroy original
+       error = FT_Glyph_Stroke( &(info->outline_glyph), render_context.stroker, 0 ); // don't destroy original
+       if (error) {
+               mp_msg(MSGT_GLOBAL, MSGL_WARN, "FT_Glyph_Stroke error %d \n", error);
+               FT_Glyph_Copy(info->glyph, &info->outline_glyph);
+       }
 
        info->bitmap = 0; // outline glyph