summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-07-24 15:16:46 +0100
committerRobin Watts <robin.watts@artifex.com>2012-07-24 15:18:55 +0100
commit83f1aed5358d314cc52b5c243f94bbecb1e4469b (patch)
tree5584cee000ddc7e7d39fcec3f2cbb1adad9bcabf
parentef036b230f33ce1d9cdd135655319d3828ca6008 (diff)
downloadghostpdl-83f1aed5358d314cc52b5c243f94bbecb1e4469b.tar.gz
When unpacking 16 bit image data, unpack it all.
Ensure we don't miss the last one off. Differences appear on the right hand edge of the images when rendering: gs -dNOINTERPOLATE -o out-%d.psd -sDEVICE=psdcmyk -r300 -dMaxBitmap=10000 fts_02_0200.pdf vs gs -dNOINTERPOLATE --debug=memfill-empty -o out-%d.psd -sDEVICE=psdcmyk -r300 -dMaxBitmap=10000 fts_02_0200.pdf
-rw-r--r--gs/base/gxi16bit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gs/base/gxi16bit.c b/gs/base/gxi16bit.c
index 6a937b6f3..8a9812b05 100644
--- a/gs/base/gxi16bit.c
+++ b/gs/base/gxi16bit.c
@@ -48,7 +48,7 @@ sample_unpack_16(byte * bptr, int *pdata_x, const byte * data,
uint sample;
int left = dsize - dskip;
- while (left > 2) {
+ while (left >= 2) {
sample = ((uint) psrc[0] << 8) + psrc[1];
*bufp = (frac)((frac_1 * (sample + 1)) >> 16);
inc_bufp(bufp, spread);