diff options
author | Nick Kralevich <nnk@google.com> | 2010-09-14 17:02:58 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2010-09-15 10:32:30 -0700 |
commit | aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c (patch) | |
tree | 2b4c5412391bf31f6a54b237ea83bfde05ec3802 /src/sfnt/ttload.c | |
parent | d4476115dee94297c020b3a2b067188117424e25 (diff) | |
download | android_external_freetype-aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c.tar.gz android_external_freetype-aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c.tar.bz2 android_external_freetype-aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c.zip |
upgrade freetype to 2.4.2.
Bug: 2969145
Change-Id: I8debbbe0bd478d9cf8c39cff5179981b5f3b371a
Diffstat (limited to 'src/sfnt/ttload.c')
-rw-r--r-- | src/sfnt/ttload.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index 3ad33bd..1c174af 100644 --- a/src/sfnt/ttload.c +++ b/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 )); |