Commit 281c148621e0382c1ba721db560602d0cdc3dc4c

Werner Lemberg 2007-01-13T22:50:51

* src/type1/t1afm.c (T1_Read_Metrics): MS Windows allows PFM versions up to 0x3FF without complaining.

diff --git a/ChangeLog b/ChangeLog
index a701fc8..661e0ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-13  Werner Lemberg  <wl@gnu.org>
+
+	* src/type1/t1afm.c (T1_Read_Metrics): MS Windows allows PFM
+	versions up to 0x3FF without complaining.
+
 2007-01-13  Derek Clegg  <dclegg@apple.com>
 
 	Add FT_Get_PS_Font_Info interface to CFF driver.
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index f4d00d6..373848b 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM support for Type 1 fonts (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -265,8 +265,9 @@
       FT_Byte*  start = stream->cursor;
 
 
+      /* MS Windows allows versions up to 0x3FF without complaining */
       if ( stream->size > 6                              &&
-           start[0] == 0x00 && start[1] == 0x01          &&
+           start[1] < 4                                  &&
            FT_PEEK_ULONG_LE( start + 2 ) == stream->size )
         error = T1_Read_PFM( t1_face, stream, fi );
     }