Commit 271b1e163310ba1df4df1cf30583eb7c8740482f

Werner Lemberg 2004-01-19T23:31:56

* src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one CR, LF, or CR/LF after `eexec'.

diff --git a/ChangeLog b/ChangeLog
index 867c3bd..58ce231 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-20  Werner Lemberg  <wl@gnu.org>
+
+	* src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one
+	CR, LF, or CR/LF after `eexec'.
+
 2004-01-18  David Turner  <david@freetype.org>
 
         * src/sfnt/ttsbit.c: removed compiler warning
@@ -31,7 +36,6 @@
           introducing the new FT_ARRAY_COPY and FT_ARRAY_MOVE macros
           to make copying arrays easier
 
-
 2004-01-14  Werner Lemberg  <wl@gnu.org>
 
 	* src/cff/cffload.c (cff_font_load): Load charstrings_index earlier.
diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c
index cc0c2f3..885d60a 100644
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -356,8 +356,22 @@
       parser->root.limit = parser->base_dict + parser->base_len;
 
       T1_Skip_PS_Token( parser );
-      T1_Skip_Spaces  ( parser );
       cur = parser->root.cursor;
+      if ( *cur == '\r' )
+      {
+        cur++;
+        if ( *cur == '\n' )
+          cur++;
+      }
+      else if ( *cur == '\n' )
+        cur++;
+      else
+      {
+        FT_ERROR(( "T1_Get_Private_Dict:" ));
+        FT_ERROR(( " `eexec' not properly terminated\n" ));
+        error = T1_Err_Invalid_File_Format;
+        goto Exit;
+      }
 
       size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) );