shithub: freetype+ttf2subf

Download patch

ref: 087b7ea6674a29c4f86f5418be64621331eabfec
parent: a5e9dbd528328fa62432326a1633e2f3d62194f8
author: John Tytgat <[email protected]>
date: Wed Nov 25 18:51:06 EST 2009

Better handling of start of `eexec' section.
This fixes Savannah bug #28090.

* src/type1/t1parse.c (T1_Get_Private_Dict): Skip all whitespace
characters before start of `eexec' section.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-11-25  John Tytgat  <[email protected]>
+
+	Better handling of start of `eexec' section.
+	This fixes Savannah bug #28090.
+
+	* src/type1/t1parse.c (T1_Get_Private_Dict): Skip all whitespace
+	characters before start of `eexec' section.
+
 2009-11-20  Werner Lemberg  <[email protected]>
 
 	Fix Savannah bug #27742.
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -397,15 +397,18 @@
 
       T1_Skip_PS_Token( parser );
       cur = parser->root.cursor;
-      if ( *cur == '\r' )
-      {
-        cur++;
-        if ( *cur == '\n' )
-          cur++;
-      }
-      else if ( *cur == '\n' )
-        cur++;
-      else
+
+      /* according to the Type1 spec, the first cipher byte must not be  */
+      /* an ASCII whitespace character code (blank, tab, carriage return */
+      /* or line feed).  We have seen Type 1 fonts with two line feed    */
+      /* characters...  So skip now all whitespace character codes.      */
+      while ( cur < limit       &&
+              ( *cur == ' '  ||
+                *cur == '\t' || 
+                *cur == '\r' ||
+                *cur == '\n' ) )
+        ++cur;
+      if ( cur >= limit )
       {
         FT_ERROR(( "T1_Get_Private_Dict:"
                    " `eexec' not properly terminated\n" ));