[MPlayer-cvslog] r23053 - trunk/libass/ass_render.c

eugeni subversion at mplayerhq.hu
Sat Apr 21 12:56:28 CEST 2007


Author: eugeni
Date: Sat Apr 21 12:56:28 2007
New Revision: 23053

Modified:
   trunk/libass/ass_render.c

Log:
Always deallocate glyphs. Fixes a memory leak.


Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c	(original)
+++ trunk/libass/ass_render.c	Sat Apr 21 12:56:28 2007
@@ -402,9 +402,6 @@ static ass_image_t* render_text(text_inf
 					&text_info->glyphs[i].bm_s, text_info->glyphs[i].be);
 			if (error)
 				text_info->glyphs[i].symbol = 0;
-			FT_Done_Glyph(text_info->glyphs[i].glyph);
-			if (text_info->glyphs[i].outline_glyph)
-				FT_Done_Glyph(text_info->glyphs[i].outline_glyph);
 
 			// cache
 			hash_val.bm_o = text_info->glyphs[i].bm_o;
@@ -412,6 +409,10 @@ static ass_image_t* render_text(text_inf
 			hash_val.bm_s = text_info->glyphs[i].bm_s;
 			cache_add_bitmap(&(text_info->glyphs[i].hash_key), &hash_val);
 		}
+		if (text_info->glyphs[i].glyph)
+			FT_Done_Glyph(text_info->glyphs[i].glyph);
+		if (text_info->glyphs[i].outline_glyph)
+			FT_Done_Glyph(text_info->glyphs[i].outline_glyph);
 	}
 
 	for (i = 0; i < text_info->length; ++i) {



More information about the MPlayer-cvslog mailing list