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

alexcher at ghostscript.com alexcher at ghostscript.com
Mon Feb 5 19:26:52 PST 2007


Author: alexcher
Date: 2007-02-05 19:26:52 -0800 (Mon, 05 Feb 2007)
New Revision: 7678

Modified:
   trunk/gs/lib/pdf_draw.ps
Log:
Pad short look-up table in the Indexed color space with 0's in PDF documents
when the table comes from a stream. Bug 688987, customer 580.

DETAILS:
Adobe Acrobat 5 detects that the look-up table is short when the table is
a string, unfiltered stream, or ASCIIHexDecode'd stream. When the stream is
FlateDecode'd the length of the decoded data is ignored and the raw memory
in the buffer is used. In most cases it's 0. We pad all streams and pass
strings intact.

DIFFERENCES:
None


Modified: trunk/gs/lib/pdf_draw.ps
===================================================================
--- trunk/gs/lib/pdf_draw.ps	2007-02-05 17:21:59 UTC (rev 7677)
+++ trunk/gs/lib/pdf_draw.ps	2007-02-06 03:26:52 UTC (rev 7678)
@@ -640,8 +640,12 @@
 	3 index
 	  dup dup type /arraytype eq { 0 get } if
 	  //csncompdict exch get exec mul
-	string readstring pop
-		% Stack: filepos /Indexed basespace hival table
+	string dup 3 1 roll readstring pop  % the string is padded with 0s
+        length 1 index length lt {
+          (   **** Warning: Short look-up table in the Indexed color space was padded with 0's.\n)
+          pdfformaterror
+        } if
+		% Stack: filepos /Indexed basespace hival table table'
 	5 -1 roll PDFfile exch setfileposition
     }
     if 4 array astore



More information about the gs-cvs mailing list