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

dan at ghostscript.com dan at ghostscript.com
Wed Jul 19 15:52:25 PDT 2006


Author: dan
Date: 2006-07-19 15:52:24 -0700 (Wed, 19 Jul 2006)
New Revision: 6921

Modified:
   trunk/gs/lib/pdf_rbld.ps
Log:
Fix for 688788 /rangecheck in resolveR.

DETAILS:

The file is damaged and has to have it xref table rebuilt.

Ralph Giles correctly guessed the cause of the problem
with his comment:
  "The file is corrupted by the addition of a leading
   newline; after removing the initial '0x0d 0x0a'
   character sequence the file renders fine. This offset
   is apparently confusing the xref table repair."

We have a value called PDFoffset which indicates the amount
of white space at the beginning of a file.  This value is
added to all xref table entry file locations when they are
referenced.  The xref rebuild logic was creating xref
locations which give the file position without considering
the value of PDFoffset.  The fix consists of simply subtracting
the values of PDFoffset from the xref object locations when
the xref tables are rebuilt.


Modified: trunk/gs/lib/pdf_rbld.ps
===================================================================
--- trunk/gs/lib/pdf_rbld.ps	2006-07-19 22:38:15 UTC (rev 6920)
+++ trunk/gs/lib/pdf_rbld.ps	2006-07-19 22:52:24 UTC (rev 6921)
@@ -271,7 +271,8 @@
 	      1 index 20 add 20 idiv 20 mul
 	      growPDFobjects
 	      % save xref parameters into ObjectStream, Objects and Generations
-	      1 index 0 4 index 3 index	% rearrange parms for setxrefentry
+	      1 index 0			% rearrange parms for setxrefentry
+	      4 index PDFoffset sub 3 index
 	      setxrefentry		% save parameters
 	      pop pop pop pop		% clear parameters
 	    } if			% check if name is 'obj'



More information about the gs-cvs mailing list