diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-04-21 10:56:28 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-04-21 10:56:28 +0000 |
commit | d489827db29c2da671c560bcb07e6082687fe7ce (patch) | |
tree | 32942cc213bb7cbf9726b3ff8bc2b2c63e8a20f9 | |
parent | 568ac27cd58b66b15af86dba119232d93290b3a4 (diff) | |
download | libass-d489827db29c2da671c560bcb07e6082687fe7ce.tar.bz2 libass-d489827db29c2da671c560bcb07e6082687fe7ce.tar.xz |
Always deallocate glyphs. Fixes a memory leak.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23053 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libass/ass_render.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index 763f548f..75bb0d5a 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -402,9 +402,6 @@ static ass_image_t* render_text(text_info_t* text_info, int dst_x, int dst_y) &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_info_t* text_info, int dst_x, int dst_y) 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) { |