Kaydet (Commit) 9ab80082 authored tarafından Mark Wielaard's avatar Mark Wielaard Kaydeden (comit) Khaled Hosny

Fix memory leak in ServerFont::GetGlyphOutline.

Always call FT_Done_Glyph before returning.

Change-Id: I861bcc66b065d9cfb909b3ea561af97caccc4593
Reviewed-on: https://gerrit.libreoffice.org/4635Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
Tested-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst e5f3e328
...@@ -2179,7 +2179,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex, ...@@ -2179,7 +2179,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex,
return false; return false;
if( pGlyphFT->format != FT_GLYPH_FORMAT_OUTLINE ) if( pGlyphFT->format != FT_GLYPH_FORMAT_OUTLINE )
{
FT_Done_Glyph( pGlyphFT );
return false; return false;
}
if( mbArtItalic ) if( mbArtItalic )
{ {
...@@ -2191,7 +2194,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex, ...@@ -2191,7 +2194,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex,
FT_Outline& rOutline = reinterpret_cast<FT_OutlineGlyphRec*>(pGlyphFT)->outline; FT_Outline& rOutline = reinterpret_cast<FT_OutlineGlyphRec*>(pGlyphFT)->outline;
if( !rOutline.n_points ) // blank glyphs are ok if( !rOutline.n_points ) // blank glyphs are ok
{
FT_Done_Glyph( pGlyphFT );
return true; return true;
}
long nMaxPoints = 1 + rOutline.n_points * 3; long nMaxPoints = 1 + rOutline.n_points * 3;
PolyPolygon aToolPolyPolygon; PolyPolygon aToolPolyPolygon;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment