diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2011-07-08 14:12:51 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2011-07-08 14:23:06 +0100 |
commit | 73c09fa015d1e5a19083001bc343abbb67992c9d (patch) | |
tree | c6fe78cf6a588ec2cb7844ada3c55d35d0859d29 /gs/base/gxiscale.c | |
parent | 02a53b643780f40f5d8947272eabb947002c40b3 (diff) | |
download | ghostpdl-73c09fa015d1e5a19083001bc343abbb67992c9d.tar.gz |
Fix Bug 692331: SEGV in image interpolation.
In fixing bug 692225, it seems I broke this.
In the setup code that decides whether decoding is required or not, I
was incorrectly choosing to use the 'decode' case, when in fact the
'decoding' is done later for CIE colorspaces. As such I should have used
the no-decode case.
Fixing this appears to cure the problem.
Diffstat (limited to 'gs/base/gxiscale.c')
-rw-r--r-- | gs/base/gxiscale.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gs/base/gxiscale.c b/gs/base/gxiscale.c index f7db9b241..2704d34d0 100644 --- a/gs/base/gxiscale.c +++ b/gs/base/gxiscale.c @@ -770,9 +770,19 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer, if (pcs->type->index != gs_color_space_index_Indexed) { /* An issue here is that we may not be "device color" due to how the data is encoded. Need to check for that case here */ - if ((penum->device_color || - gs_color_space_is_CIE(pcs) || - islab) && (penum->icc_setup.need_decode == 0)) { + /* Decide here if we need to decode or not. Essentially, as + * far as I can gather, we use the top case if we DON'T need + * to decode. This is fairly obviously conditional on + * need_decode being set to 0. The major exception to this is + * that if the colorspace is CIE, we interpolate, THEN decode, + * so the decode is done later in the pipeline, so we needn't + * decode here (see Bugs 692225 and 692331). */ + /* It is possible that islab should be moved out of conjuction + * with need_decode below, but in the absence of a test file, + * I'm leaving it where it is. */ + if (((penum->device_color || islab) && + (penum->icc_setup.need_decode == 0)) || + gs_color_space_is_CIE(pcs)) { /* 8-bit color values, possibly device indep. or device depend., not indexed. Decode range was [0 1] */ if (penum->matrix.xx >= 0) { |