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.
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 47 48
diff --git a/ChangeLog b/ChangeLog
index d8c78d4..18d94eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-11-25 John Tytgat <John.Tytgat@esko.com>
+
+ 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 <wl@gnu.org>
Fix Savannah bug #27742.
diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c
index 1bef56b..2a76227 100644
--- 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" ));