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/gxblend1.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/gxblend1.c')
-rw-r--r-- | base/gxblend1.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/base/gxblend1.c b/base/gxblend1.c index 6d42a0941..cb14f5240 100644 --- a/base/gxblend1.c +++ b/base/gxblend1.c @@ -226,6 +226,7 @@ pdf14_preserve_backdrop_cm(pdf14_buf *buf, cmm_profile_t *group_profile, int y0 = max(buf->rect.p.y, tos->rect.p.y); int y1 = min(buf->rect.q.y, tos->rect.q.y); bool deep = buf->deep; + int code; if (x0 < x1 && y0 < y1) { int width = x1 - x0; @@ -283,9 +284,11 @@ pdf14_preserve_backdrop_cm(pdf14_buf *buf, cmm_profile_t *group_profile, false, true, buf->planestride, buf->rowstride, height, width); /* Transform the data. */ - (icc_link->procs.map_buffer)(dev, icc_link, &input_buff_desc, + code = (icc_link->procs.map_buffer)(dev, icc_link, &input_buff_desc, &output_buff_desc, tos_plane, buf_plane); gsicc_release_link(icc_link); + if (code < 0) + return gs_throw(gs_error_unknownerror, "ICC transform failed. Trans backdrop"); } /* Copy the alpha data */ buf_plane += buf->planestride * (buf->n_chan - 1); |