[gs-cvs] rev 7467 - trunk/gs/src

tor at ghostscript.com tor at ghostscript.com
Fri Dec 8 06:38:27 PST 2006


Author: tor
Date: 2006-12-08 06:38:26 -0800 (Fri, 08 Dec 2006)
New Revision: 7467

Modified:
   trunk/gs/src/gstype42.c
Log:
Fix some errors in the TTC table parsing.

Modified: trunk/gs/src/gstype42.c
===================================================================
--- trunk/gs/src/gstype42.c	2006-12-08 12:00:09 UTC (rev 7466)
+++ trunk/gs/src/gstype42.c	2006-12-08 14:38:26 UTC (rev 7467)
@@ -116,20 +116,24 @@
     ACCESS(0, 12, OffsetTable);
     if (!memcmp(OffsetTable, version_ttcf, 4))
     {
-	numFonts = U16(OffsetTable + 8);
+	numFonts = u32(OffsetTable + 8);
 	if (subfontID < 0 || subfontID >= numFonts)
 	    return_error(gs_error_rangecheck);
-	ACCESS(8, numFonts * 4, OffsetTable);
+	ACCESS(12, numFonts * 4, OffsetTable);
 	OffsetTableOffset = u32(OffsetTable + subfontID * 4);
 	ACCESS(OffsetTableOffset, 12, OffsetTable);
     }
+    else
+    {
+	OffsetTableOffset = 0;
+    }
 
     if (memcmp(OffsetTable, version1_0, 4) &&
 	    memcmp(OffsetTable, version_true, 4))
 	return_error(gs_error_invalidfont);
 
     numTables = U16(OffsetTable + 4);
-    ACCESS(12, numTables * 16, TableDirectory);
+    ACCESS(OffsetTableOffset + 12, numTables * 16, TableDirectory);
     /* Clear all non-client-supplied data. */
     {
 	void *proc_data = pfont->data.proc_data;



More information about the gs-cvs mailing list