diff options
author | Mark Wielaard <mark@klomp.org> | 2013-06-30 17:08:56 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2013-06-30 20:23:56 +0000 |
commit | 9ab800829b8a0e44824dc11276b54b1870bc5b2b (patch) | |
tree | a1f22ca7d3701cf042918f96b14ef4b6657fdae3 /vcl/generic/glyphs | |
parent | e5f3e328a2ffe86425c571bb43ffd3f3f650db81 (diff) |
Fix memory leak in ServerFont::GetGlyphOutline.
Always call FT_Done_Glyph before returning.
Change-Id: I861bcc66b065d9cfb909b3ea561af97caccc4593
Reviewed-on: https://gerrit.libreoffice.org/4635
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Tested-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/generic/glyphs')
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index d75c7d2738a6..29c88203517f 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -2179,7 +2179,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex, return false; if( pGlyphFT->format != FT_GLYPH_FORMAT_OUTLINE ) + { + FT_Done_Glyph( pGlyphFT ); return false; + } if( mbArtItalic ) { @@ -2191,7 +2194,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex, FT_Outline& rOutline = reinterpret_cast<FT_OutlineGlyphRec*>(pGlyphFT)->outline; if( !rOutline.n_points ) // blank glyphs are ok + { + FT_Done_Glyph( pGlyphFT ); return true; + } long nMaxPoints = 1 + rOutline.n_points * 3; PolyPolygon aToolPolyPolygon; |