aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/sfnt/ttload.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-08-06 11:48:36 +0000
committermarha <marha@users.sourceforge.net>2010-08-06 11:48:36 +0000
commit20ff8ddf2d9bb41050d10bbc75d61b9161880c7c (patch)
tree22566fcd9663b2baa565cd0c64eaa662d6ba03ee /freetype/src/sfnt/ttload.c
parentc29011f2831315d3da9c4727c1e626d80520b97a (diff)
parent6849d83857b4e470a44ad8b6aa5cfb283fd64c89 (diff)
downloadvcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.tar.gz
vcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.tar.bz2
vcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.zip
svn merge ^/branches/released .
Diffstat (limited to 'freetype/src/sfnt/ttload.c')
-rw-r--r--freetype/src/sfnt/ttload.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/freetype/src/sfnt/ttload.c b/freetype/src/sfnt/ttload.c
index 17c65e551..aadd1d5f6 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 ));