[vlc-devel] [vlc-commits] freetype: fix crash (wrong memory deallocation)

brezhoneg1 brezhoneg1 at yahoo.fr
Mon Sep 12 19:44:50 CEST 2011


Hi,

On 12/09/2011 11:31, Laurent Aimar wrote:
> On Mon, Sep 12, 2011 at 11:27:09AM +0200, Erwan Tulou wrote:
>    
>> vlc | branch: master | Erwan Tulou<erwan10 at videolan.org>  | Sat Sep 10 00:25:55 2011 +0200| [2224fa034a7a205ba9ec810e67e2889a2bca4471] | committer: Erwan Tulou
>>
>> freetype: fix crash (wrong memory deallocation)
>>
>> shadow refers to outine or glyph. Only these latter ones need deallocation.
>>      
>   I don't think so. Unless I misread the freetype API they also need deallocation.
>
>      FT_Glyph shadow = NULL;
>      if( p_filter->p_sys->i_shadow_opacity>  0 )
>      {
>          shadow = outline ? outline : glyph;
>          FT_Glyph_To_Bitmap(&shadow, FT_RENDER_MODE_NORMAL, p_pen_shadow, 0 );
>          FT_Glyph_Get_CBox( shadow, ft_glyph_bbox_pixels, p_shadow_bbox );
>      }
>      *pp_shadow = shadow;
>
> The result of FT_Glyph_To_Bitmap need deallocation I think:
> http://www.freetype.org/freetype2/docs/reference/ft2-glyph_management.html#FT_Glyph_To_Bitmap
>    

Yes, things need more investigation. My patch was a bit hasty to remove 
a crash in libfreetype that looked like trying to free a pointer already 
freed.



More information about the vlc-devel mailing list