Commit 364db0826bc9da79c714426c9327b96a0ff78b6b

Werner Lemberg 2005-12-07T20:34:11

* src/sfnt/sfobjc.c (sfnt_init_face): Move tag check to... * src/sfnt/ttload.c (sfnt_init): Here, before handling TTCs.

diff --git a/ChangeLog b/ChangeLog
index 16fe7ff..801b05d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-07  Werner Lemberg  <wl@gnu.org>
+
+	* src/sfnt/sfobjc.c (sfnt_init_face): Move tag check to...
+	* src/sfnt/ttload.c (sfnt_init): Here, before handling TTCs.
+
 2005-12-06  Chia-I Wu  <b90201047@ntu.edu.tw>
 
 	* src/truetype/ttobjs.c (tt_size_init): size->ttmetrics.valid is
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index d65b69c..991705d 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -376,13 +376,6 @@
     if ( error )
       goto Exit;
 
-    if ( sfnt_header.format_tag != 0x00010000UL                      &&
-         sfnt_header.format_tag != TTAG_ttcf                         &&
-         sfnt_header.format_tag != FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) &&
-         sfnt_header.format_tag != TTAG_true                         &&
-         sfnt_header.format_tag != 0x00020000UL                      )
-      return SFNT_Err_Unknown_File_Format;
-
     face->format_tag = sfnt_header.format_tag;
     face->num_tables = sfnt_header.num_tables;
 
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 67c5048..2f0af79 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -266,6 +266,13 @@
     if ( FT_READ_ULONG( tag ) )
       return error;
 
+    if ( tag != 0x00010000UL                      &&
+         tag != TTAG_ttcf                         &&
+         tag != FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) &&
+         tag != TTAG_true                         &&
+         tag != 0x00020000UL                      )
+      return SFNT_Err_Unknown_File_Format;
+
     face->ttc_header.tag = TTAG_ttcf;
 
     if ( tag == TTAG_ttcf )