[gs-bugs] [Bug 691941] Interpretation of PDF aborts with /typecheck

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Tue Feb 8 14:23:49 UTC 2011


--- Comment #3 from Ken Sharp <ken.sharp at artifex.com> 2011-02-08 14:23:47 UTC ---
Created an attachment (id=7217)
 --> (http://bugs.ghostscript.com/attachment.cgi?id=7217)
Patch to gs/psi/zcolor.c to process specimen file

The image in the PDF file has what appears to be a doubtful colour space. It is
defined as (paraphrasing the actual content):

/Indexed [/ICCBased <</N 1 /Alternate [/Indexed /DeviceRGB 255 7 0 R]>>] 255 7
0 R]

The spec says that an Indexed space cannot have a /Indexed space as an
alternate. Of course its a little gray here, because we are mapping through an
ICCBased space, but it doesn't look like a good idea to me.

The ICCBased space says it takes one component, but it uses the same data
string as the 3 component RGB space. Firstly there's no sense in a 1-component
ICCBased colour space being Indexed, it doesn't save any space. Secondly it
seems unlikely that a data string intended to map 256 values into RGB triplets
would also map into 256 entries in an ICC table.

Its not impossible, but it looks dubious to me, the first 255 bytes of data
would have to be 85 RGB triplets, and *at the same time* 255 values for the ICC
colour engine. The ICC data claims to be an HP sRGB, so I really don't think
its likely that the RGB triplets are correct. Of course it could be that the
RGB indexed data is correct, but that the first 255 bytes are not correct for
the 1-channel ICC profile. 

The typecheck is caused by an incorrect assignment of a reference in the colour
processing code. A patch to address this is attached. Unfortunately we are in
code freeze for the 9.01 release and so I can't commit this to the repository
at present.

With the patch in place the job runs to completion. It does not render the same
as Acrobat, but I suspect this is due to the problems with the ICCBased space
noted above. My suspicion is that Acrobat is checking the declared number of
channels in the ICCBased space (/N 1) against the ICC profile, determining that
they are incompatible (I suspect this is a 3 channel profile) and reverting to
the ICC Alternate space.

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list