From 7890686d8082b914f86f12de5cf8c61248b17eff Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 22 May 2007 14:08:09 +0000 Subject: [PATCH] fix crash when not using the bytecode interpreter with TrueType fonts --- ChangeLog | 3 +++ src/truetype/ttgload.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd8c99ef4..dd600cbcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-22 David Turner + * 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 1f75a2c3e..6e9cc808a 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 */