Commit af48e32c17a5f5ab88509c3730fd875a2e94a990

David Turner 2002-05-01T08:38:08

* src/sfnt/ttload.c (TT_Load_Names): applied a small work-around to manage fonts containing a broken name table (e.g. "hya6gb.ttf")

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index bbef665..0f6788c 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -987,6 +987,12 @@
 
     /* check the 'storageOffset' field */
     storageOffset = names->storageOffset;
+
+    /* some broken asian fonts have a storage offset whose value is */
+    /* 12*numNameRecords. We deal with them here..                  */
+    if ( storageOffset == 12 * names->numNameRecords )
+      storageOffset += 6;
+    
     if ( storageOffset <  (FT_ULong)( 6 + 12 * names->numNameRecords ) ||
          table_len     <= storageOffset                                )
     {