[gs-cvs] gs/lib
Ray Johnston
ray at ghostscript.com
Tue Apr 19 23:13:13 PDT 2005
Update of /cvs/ghostscript/gs/lib
In directory casper2:/tmp/cvs-serv11889/lib
Modified Files:
pdf_draw.ps
Log Message:
Prevent out of range ImageType 4 mask array entries from causing an error
as Adobe Acrobat Reader does. But 687
quit: No revelant features.
Index: pdf_draw.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_draw.ps,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- pdf_draw.ps 14 Mar 2005 18:08:39 -0000 1.91
+++ pdf_draw.ps 20 Apr 2005 06:13:11 -0000 1.92
@@ -888,7 +888,18 @@
pdfformaterror
[ exch { 0.5 add cvi } forall ] % following AR4, 5, 6 implementation
} if
- /MaskColor exch def
+ % Check elements of array are within 0::(2**BitsPerComponent)-1
+ % This is a PostScript error, but AR ignores Mask in that case
+ 2 BitsPerComponent exp cvi 1 sub //false 2 index {
+ % stack: max_value result_bool value
+ dup 0 lt exch 3 index gt or or
+ } forall exch pop {
+ (\n **** Warning: Some elements of Mask array are out of range.\n)
+ pdfformaterror
+ pop /ImageType 1 def % revert to non-masked image
+ } {
+ /MaskColor exch def
+ } ifelse
} {
% Mask is a stream, another Image XObject.
% Stack: datasource imagemask(false) maskstreamdict
More information about the gs-cvs
mailing list