shithub: freetype+ttf2subf

Download patch

ref: 3033f4366b68024ca56f53a53e568e1805436446
parent: 986ea4b2cbdcec86da548e1a3681df5441cc3d50
author: Werner Lemberg <[email protected]>
date: Wed Jul 4 10:12:19 EDT 2007

* 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.

git/fs: mount .git/fs: mount/attach disallowed
--- 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  <[email protected]>
 
 	* src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
--- 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 )
--- 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;