shithub: freetype+ttf2subf

Download patch

ref: 364db0826bc9da79c714426c9327b96a0ff78b6b
parent: 3b8db6694128274acc859da0b130fd85e55e52ac
author: Werner Lemberg <[email protected]>
date: Wed Dec 7 15:34:11 EST 2005

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

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-07  Werner Lemberg  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* src/truetype/ttobjs.c (tt_size_init): size->ttmetrics.valid is
--- 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;
 
--- 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 )