[sfnt] Ignore invalid magic number in `head' or `bhed'. Other font engines seem to ignore it also. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/sfnt/ttload.c (check_table_dir): Don't abort but warn only if we have an invalid magic number.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/ChangeLog b/ChangeLog
index bf47171..dc27c1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-07-18 Werner Lemberg <wl@gnu.org>
+
+ [sfnt] Ignore invalid magic number in `head' or `bhed'.
+
+ Other font engines seem to ignore it also. Problem reported by
+ Hin-Tak Leung <htl10@users.sourceforge.net>.
+
+ * src/sfnt/ttload.c (check_table_dir): Don't abort but warn only if
+ we have an invalid magic number.
+
2013-07-16 Werner Lemberg <wl@gnu.org>
[smooth] Fix segfault caused by previous commit.
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index fbe70f7..89a8ae0 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -236,7 +236,8 @@
*/
if ( table.Length < 0x36 )
{
- FT_TRACE2(( "check_table_dir: `head' table too small\n" ));
+ FT_TRACE2(( "check_table_dir:"
+ " `head' or `bhed' table too small\n" ));
error = FT_THROW( Table_Missing );
goto Exit;
}
@@ -246,12 +247,8 @@
goto Exit;
if ( magic != 0x5F0F3CF5UL )
- {
FT_TRACE2(( "check_table_dir:"
- " no magic number found in `head' table\n"));
- error = FT_THROW( Table_Missing );
- goto Exit;
- }
+ " invalid magic number in `head' or `bhed' table\n"));
if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) )
goto Exit;