From 5aeaad6c3900fc66aead452d35a0a3059d2afa35 Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 23 Feb 2001 17:47:41 +0000 Subject: [PATCH] fixed a bug reported by Graham Asher --- ChangeLog | 9 +++++++++ src/base/ftglyph.c | 6 ++++++ src/smooth/ftgrays.c | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6495ede56..04802b721 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-02-22 David Turner + + * src/base/ftgrays.c (grays_sweep): the function didn't exit + immediately if "num_cells" was 0 as it should. Thanks to Boris + for finding this out. + + * src/base/ftglyph.c (FT_Glyph_To_Bitmap): fixed memory leak when + bitmap rendering fails.. (thanks to Graham Asher) + 2001-02-13 Werner Lemberg * docs/docmaker.py (DocSection::add_element): Use diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c index 95049ae60..20d2cdf2b 100644 --- a/src/base/ftglyph.c +++ b/src/base/ftglyph.c @@ -602,6 +602,12 @@ if ( !error ) error = FT_Render_Glyph_Internal( glyph->library, &dummy, render_mode ); + if (error) + { + FT_Glyph_Done( FT_GLYPH(bitmap) ); + goto Exit; + } + if ( !destroy && origin ) { FT_Vector v; diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index d06bb28ea..291e62eb1 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -1359,7 +1359,9 @@ FT_UNUSED( target ); - + if ( ras.num_cells == 0 ) + return; + cur = ras.cells; limit = cur + ras.num_cells;