Fix for 687473, /invalidrestore in --restore--

Alex Cherepanov <[email protected]> Mon, 31 May 2004 15:35:22 -0400
Newsgroups gmane.comp.printing.ghostscript.patches
Organization Coscript Software
Message-ID <[email protected]>
Keep the operands of an pseudo-operator on the stack to ensure proper
restoration of the operands at the end. Correctly adjust the stack
in the caller when knownoget_safe fails.
Fix bug 687473 from the customer 780.

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
pdf_main.ps.diff (text/plain, 650 B)
Index: gs/lib/pdf_main.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_main.ps,v
retrieving revision 1.86
diff -b -u -r1.86 pdf_main.ps
--- gs/lib/pdf_main.ps	1 Apr 2004 06:14:00 -0000	1.86
+++ gs/lib/pdf_main.ps	31 May 2004 19:47:07 -0000
@@ -567,11 +567,11 @@
 } bind def
 
 /knownoget_safe
-{ knownoget
+{ 2 copy knownoget { 3 1 roll pop pop //true } { pop pop //false } if
 } odef
 
 /printProducer {
-  Trailer /Info { knownoget_safe } stopped { false } if {
+  Trailer /Info { knownoget_safe } stopped { pop pop false } if {
     /Producer knownoget not { null } if
   } {
     null