* src/truetype/ttgload.c (load_truetype_glyph): Always allow a recursion depth of 1. This was the maximum value in TrueType 1.0, and some older fonts don't set this field correctly. * src/gxvalid/gxvmort1.c (gxv_mort_subtable_type1_substTable_validate): Fix tracing message.
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 40 41 42 43 44 45 46
diff --git a/ChangeLog b/ChangeLog
index 6184575..c5b80ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,13 @@
* docs/PROBLEMS: Mention that some PS based fonts can't be
handled correctly by FreeType.
+ * src/truetype/ttgload.c (load_truetype_glyph): Always allow a
+ recursion depth of 1. This was the maximum value in TrueType 1.0,
+ and some older fonts don't set this field correctly.
+
+ * src/gxvalid/gxvmort1.c
+ (gxv_mort_subtable_type1_substTable_validate): Fix tracing message.
+
2007-07-03 Werner Lemberg <wl@gnu.org>
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
diff --git a/src/gxvalid/gxvmort1.c b/src/gxvalid/gxvmort1.c
index 0575b12..711bbd0 100644
--- a/src/gxvalid/gxvmort1.c
+++ b/src/gxvalid/gxvmort1.c
@@ -202,7 +202,7 @@
if ( dst_gid > valid->face->num_glyphs )
{
- GXV_TRACE(( "substTable include toolarge gid[%d]=%d >"
+ GXV_TRACE(( "substTable include too large gid[%d]=%d >"
" max defined gid #%d\n",
i, dst_gid, valid->face->num_glyphs ));
if ( valid->root->level >= FT_VALIDATE_PARANOID )
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index ae476a4..29736ab 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1084,7 +1084,9 @@
#endif
- if ( recurse_count > face->max_profile.maxComponentDepth )
+ /* some fonts haven't this field set correctly, */
+ /* thus we add 1 to catch the majority of them */
+ if ( recurse_count > (FT_UInt)face->max_profile.maxComponentDepth + 1 )
{
error = TT_Err_Invalid_Composite;
goto Exit;