Commit f4a52a6c422a190be6d2b04d15e89cd2c627b2aa

Werner Lemberg 2007-04-09T08:40:11

* src/truetype/ttgload.c (load_truetype_glyph): Save and restore memory stream to avoid a crash with the incremental memory interface (Savannah bug #19260).

diff --git a/ChangeLog b/ChangeLog
index fc4b154..a6306e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-09  Martin Horak  <horakm@centrum.cz>
+
+	* src/truetype/ttgload.c (load_truetype_glyph): Save and restore
+	memory stream to avoid a crash with the incremental memory
+	interface (Savannah bug #19260).
+
 2007-04-06  David Turner  <david@freetype.org>
 
 	* src/base/ftbimap.c (ft_bitmap_assure_buffer): Fix buffer-overwrite bug
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index e9af0f5..4d7f61e 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1377,6 +1377,8 @@
         FT_UInt      num_subglyphs  = gloader->current.num_subglyphs;
         FT_UInt      num_base_subgs = gloader->base.num_subglyphs;
 
+        FT_Stream    old_stream     = loader->stream;
+
 
         FT_GlyphLoader_Add( gloader );
 
@@ -1430,6 +1432,7 @@
                                           num_base_points );
         }
 
+        loader->stream = old_stream;
 
         /* process the glyph */
         loader->ins_pos = ins_pos;