[gs-cvs] rev 8748 - trunk/gs/lib

alexcher at ghostscript.com alexcher at ghostscript.com
Mon May 19 17:52:25 PDT 2008


Author: alexcher
Date: 2008-05-19 17:52:25 -0700 (Mon, 19 May 2008)
New Revision: 8748

Modified:
   trunk/gs/lib/gs_cff.ps
Log:
Consider Index object in CFF font as empty if the offset element size is
incorrect. Bug 689854, customer 580.

DETAILS:
The rationale behind this decision is that the index is, probably,
not used when it is malformed but the file survives in the wild.

DIFFERENCES:
None.


Modified: trunk/gs/lib/gs_cff.ps
===================================================================
--- trunk/gs/lib/gs_cff.ps	2008-05-19 14:47:52 UTC (rev 8747)
+++ trunk/gs/lib/gs_cff.ps	2008-05-20 00:52:25 UTC (rev 8748)
@@ -232,10 +232,16 @@
 def
 /Index {	% <name> Index <name> <array>
   CFFDEBUG { (% reading Index: ) print dup = } if
-  mark card16 dup 0 ne {
-    1 exch next offsetproc dup exec pop exch {
-      dup exec dup 4 -1 roll sub 3 1 roll exch
-    } repeat pop
+  mark card16
+  dup 0 ne {
+    1 exch next
+    dup 0 eq { 
+      pop       % skip incorrect index, bug 689854
+    } {
+      offsetproc dup exec pop exch {
+        dup exec dup 4 -1 roll sub 3 1 roll exch
+      } repeat
+    } ifelse pop
   } if pop .packtomark
   CFFDEBUG { (% Index lengths = ) print dup === } if
   [ exch { nextstring } forall ] readonly



More information about the gs-cvs mailing list