From 47ed6413ce8f2586b8d542dc46055e075a47022e Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 6 Aug 2010 10:14:25 +0000 Subject: Updated to freetype 2.4.1 --- freetype/src/sfnt/ttload.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'freetype/src/sfnt/ttload.c') diff --git a/freetype/src/sfnt/ttload.c b/freetype/src/sfnt/ttload.c index 3ad33bd6d..1c174aff9 100644 --- a/freetype/src/sfnt/ttload.c +++ b/freetype/src/sfnt/ttload.c @@ -5,7 +5,8 @@ /* Load the basic TrueType tables, i.e., tables that can be either in */ /* TTF or OTF fonts (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -77,7 +78,8 @@ { /* For compatibility with Windows, we consider */ /* zero-length tables the same as missing tables. */ - if ( entry->Tag == tag ) { + if ( entry->Tag == tag ) + { if ( entry->Length != 0 ) { FT_TRACE4(( "found table.\n" )); @@ -693,6 +695,15 @@ maxProfile->maxTwilightPoints = 0xFFFFU - 4; } + + /* we arbitrarily limit recursion to avoid stack exhaustion */ + if ( maxProfile->maxComponentDepth > 100 ) + { + FT_TRACE0(( "tt_face_load_maxp:" + " abnormally large component depth (%d) set to 100\n", + maxProfile->maxComponentDepth )); + maxProfile->maxComponentDepth = 100; + } } FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs )); -- cgit v1.2.3