Commit e6b6f3733ebf4b7f95eb56180f79dbacd21c8d50

Werner Lemberg 2007-01-07T00:06:47

* src/cid/cidparse.c (cid_parser_new): Reject Type 42 CID-keyed fonts.

diff --git a/ChangeLog b/ChangeLog
index 4055424..8203510 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-07  Werner Lemberg  <wl@gnu.org>
+
+	* src/cid/cidparse.c (cid_parser_new): Reject Type 42 CID-keyed
+	fonts.
+
 2007-01-06  Werner Lemberg  <wl@gnu.org>
 
 	* src/cff/cffload.c (cff_index_init): Remove unused variable.
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index ac56363..3d342f2 100644
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 parser (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,       */
@@ -183,6 +183,11 @@
       goto Again;
 
   Exit:
+    if ( !parser->postscript )
+    {
+      FT_TRACE2(( "[not a valid CID-keyed font]\n" ));
+      error = CID_Err_Unknown_File_Format;
+    }
     return error;
   }