summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-03-01 15:04:38 +0000
committerRobin Watts <robin.watts@artifex.com>2016-03-01 16:04:10 +0000
commit579f5891d69bcb057f27e44d49bf686d64a9f2ee (patch)
treec65bcecaae2a7dcb68e778c95cb2abf785531f11
parent3c4c85ae660c22d8442c3a9ea17bbc295f2a2fac (diff)
downloadghostpdl-579f5891d69bcb057f27e44d49bf686d64a9f2ee.tar.gz
Bug 696620: Avoid rangecheck errors in tiff devices.
Only write downscaler options if we will read them.
-rw-r--r--devices/gdevtifs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/devices/gdevtifs.c b/devices/gdevtifs.c
index 10487aa33..017153199 100644
--- a/devices/gdevtifs.c
+++ b/devices/gdevtifs.c
@@ -101,9 +101,11 @@ tiff_get_some_params(gx_device * dev, gs_param_list * plist, int which)
ecode = code;
if ((code = param_write_long(plist, "AdjustWidth", &tfdev->AdjustWidth)) < 0)
ecode = code;
- if ((code = gx_downscaler_write_params(plist, &tfdev->downscale,
- GX_DOWNSCALER_PARAMS_MFS | (which & 2 ? GX_DOWNSCALER_PARAMS_TRAP : 0))) < 0)
- ecode = code;
+ if (which & 1) {
+ if ((code = gx_downscaler_write_params(plist, &tfdev->downscale,
+ GX_DOWNSCALER_PARAMS_MFS | (which & 2 ? GX_DOWNSCALER_PARAMS_TRAP : 0))) < 0)
+ ecode = code;
+ }
return ecode;
}