Bug 688933

Summary: Uncolored Postscript patterns rendered wrongly when GraphicsAlphaBits > 1
Product: Ghostscript Reporter: Konstantin Shemyak <konstantin>
Component: PS InterpreterAssignee: Michael Vrhel <michael.vrhel>
Status: RESOLVED FIXED    
Severity: minor CC: alex, christinedelight.top85, konstantin
Priority: P4 Keywords: bountiable
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---
Bug Depends on:    
Bug Blocks: 688580, 688588    
Attachments: pattern-bug.ps

Description Konstantin Shemyak 2006-10-07 01:29:01 UTC
An example of "uncolored Postscript pattern" from the Adobe Postscript Language
Manual crashes the interpreter, when the device has alpha bits:

$ gs -dGraphicsAlphaBits=4  pattern-bug.ps
GPL Ghostscript 8.54 (2006-05-17)
Copyright (C) 2006 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 8.54: Unrecoverable error, exit code 255

The error is triggered in gxpcmap.c:pattern_accum_get_bits_rectangle().
Uncolored pattern has padev->bits == NULL (but padev->mask != NULL).

This is evolution of bugs 688580 and 688588.
Comment 1 Marcos H. Woehrmann 2006-10-17 00:11:32 UTC
I've verified the problem occurs as per the users comments (using gs854 and gshead and -
sDEVICE=pngalpha).  I'm assigning this to Ray since it may be a duplicate of 688580.
Comment 2 Marcos H. Woehrmann 2006-11-06 19:55:40 UTC
Created attachment 2583 [details]
pattern-bug.ps
Comment 3 leonardo 2007-08-29 20:45:42 UTC
Bumping the priority for crashes.
Comment 4 leonardo 2007-08-29 23:21:55 UTC
It is a failure, not crash.
I reproduced it with 8.54 but current HEAD works fine.
Closing as worksforme.
Comment 5 Konstantin Shemyak 2007-08-30 02:16:50 UTC
Fix in rev.8106 (file src/gxpcmap.c) "shuts down the messenger", but the
interpreter does not work correctly. Uncolored patterns are rendered wrongly,
such as the same attached example.
Reopening with "minor" severity.
Comment 6 leonardo 2007-08-30 10:21:48 UTC
Dear Konstantin, it would be better if you open a separate bug for wrong 
pattern rendering. Normally we don't like to change bug title except for fixing 
a typoe.
Comment 7 Alex Cherepanov 2011-07-07 04:39:29 UTC
The problem is confirmed iv vv. 9.01 and 9.02 but it is fixed in the current development version.