changeset 19002:da05237044c2

Ignoring FT_Glyph_Stroke() errors can potentially lead to double free().
author eugeni
date Mon, 10 Jul 2006 23:57:17 +0000
parents 31b7033c573e
children 9dc06456af0f
files libass/ass_render.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_render.c	Mon Jul 10 23:55:40 2006 +0000
+++ b/libass/ass_render.c	Mon Jul 10 23:57:17 2006 +0000
@@ -1120,7 +1120,11 @@
 	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