diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2020-11-20 11:45:50 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2020-11-20 12:22:25 -0800 |
commit | bd48c43be5f736393372dffbad627ed6fc486238 (patch) | |
tree | 733d317ab37cf972e545a7de29d8548fc5da2978 /base/gxiscale.c | |
parent | bccfeb0626074ca7cf2a60b194509b8b94b38327 (diff) | |
download | ghostpdl-bd48c43be5f736393372dffbad627ed6fc486238.tar.gz |
Bug 703164: Endian issues with CMM
The interface code to the CMM was corrected to indicate when a
endian swap was needed on the data. This should only occur
in the case when we are dealing with transparency buffers
during the put image blending operation that may include
a color conversion. The final blend bakes the data as BE
so if we are on a LE machine, the CMM will need to know to
swap the bytes (assuming the pdf14 device is using 16bit buffers).
The code was rewritten to make it clear that this setting is no
BE vs LE but simply an endian swap. That was a source of confusion.
Revealed in this testing was the lack of some proper error
reporting during buffer conversions, which were fixed.
Diffstat (limited to 'base/gxiscale.c')
-rw-r--r-- | base/gxiscale.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/base/gxiscale.c b/base/gxiscale.c index f175fd22a..3540fa1d8 100644 --- a/base/gxiscale.c +++ b/base/gxiscale.c @@ -2187,9 +2187,12 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer, 1, width_in); /* Do the transformation */ psrc = (byte*) (stream_r.ptr + 1); - (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc, + code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc, &output_buff_desc, (void*) psrc, (void*) p_cm_buff); + if (code < 0) + return code; + /* Re-set the reading stream to use the cm data */ stream_r.ptr = p_cm_buff - 1; stream_r.limit = stream_r.ptr + num_bytes_decode * width_in * spp_cm; @@ -2248,11 +2251,13 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer, pinterp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_decode; p_cm_interp = (unsigned short *) p_cm_buff; p_cm_interp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_cm; - (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, + code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc, &output_buff_desc, (void*) pinterp, (void*) p_cm_interp); + if (code < 0) + return code; } code = irii_core(penum, xo, xe, spp_cm, p_cm_interp, dev, abs_interp_limit, bpp, raster, yo, dy, lop); if (code < 0) @@ -2676,9 +2681,12 @@ image_render_interpolate_landscape_icc(gx_image_enum * penum, 1, width_in); /* Do the transformation */ psrc = (byte*) (stream_r.ptr + 1); - (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc, + code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc, &output_buff_desc, (void*) psrc, (void*) p_cm_buff); + if (code < 0) + return code; + /* Re-set the reading stream to use the cm data */ stream_r.ptr = p_cm_buff - 1; stream_r.limit = stream_r.ptr + num_bytes_decode * width_in * spp_cm; @@ -2750,11 +2758,13 @@ image_render_interpolate_landscape_icc(gx_image_enum * penum, pinterp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_decode; p_cm_interp = (unsigned short *) p_cm_buff; p_cm_interp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_cm; - (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, + code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc, &output_buff_desc, (void*) pinterp, (void*) p_cm_interp); + if (code < 0) + return code; } for (x = xo; x < xe;) { #ifdef DEBUG |