[gs-code-review] Fix for 687494, rangecheck error while processing image

Alex Cherepanov alexcher at coscript.com
Wed Jun 2 13:24:10 PDT 2004


Round elements of Mask array to the nearest integer following AR6
implementation.
Fix bug 687494 from customer 580.

Sorry, my previous message about this bug had a wrong attachment.
Please ignore it.

-------------- next part --------------
Index: gs/lib/pdf_draw.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_draw.ps,v
retrieving revision 1.81
diff -b -u -r1.81 pdf_draw.ps
--- gs/lib/pdf_draw.ps	24 May 2004 17:56:39 -0000	1.81
+++ gs/lib/pdf_draw.ps	2 Jun 2004 20:11:07 -0000
@@ -872,6 +872,14 @@
 			%   imagedict
   dup type /arraytype eq {
     /ImageType 4 def
+                % Check that every element of the Mask is an integer.
+    //false 1 index {
+      type /integertype ne or
+    } forall {
+      (\n   **** Warning: Some elements of Mask array are not integers.\n)
+      pdfformaterror
+      [ exch { 0.5 add cvi } forall ]  % following AR6 implementation
+    } if
     /MaskColor exch def
   } {
 		% Mask is a stream, another Image XObject.


More information about the gs-code-review mailing list