fix crash when not using the bytecode interpreter with TrueType fonts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/ChangeLog b/ChangeLog
index dd8c99e..dd600cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2007-05-22 David Turner <david@freetype.org>
+ * src/truetype/ttgload.c: fix Werner's recent graphics state
+ patch to avoid crashes when we don't use the bytecode interpreter !
+
* src/lzw/ftzopen.h, src/lzw/ftzopen.c: fix for bug #19910
(heap blowup with very large .Z font file). The .Z format is
*really* crappy :-(
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 1f75a2c..6e9cc80 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1382,7 +1382,10 @@
FT_Stream old_stream = loader->stream;
- TT_GraphicsState saved_GS = loader->exec->GS;
+ TT_GraphicsState saved_GS;
+
+ if (loader->exec)
+ saved_GS = loader->exec->GS;
FT_GlyphLoader_Add( gloader );
@@ -1394,7 +1397,8 @@
/* reinitialize graphics state */
- loader->exec->GS = saved_GS;
+ if (loader->exec)
+ loader->exec->GS = saved_GS;
/* Each time we call load_truetype_glyph in this loop, the */
/* value of `gloader.base.subglyphs' can change due to table */