summaryrefslogtreecommitdiff
path: root/libtiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2015-08-31 15:05:57 +0000
committerEven Rouault <even.rouault@spatialys.com>2015-08-31 15:05:57 +0000
commit704f717cf5eceb70d6eca3840776c2c6ee857250 (patch)
tree3792da9467869e805310eaf8721f8edbb5716de0 /libtiff
parent45e29cce8d97a5fd7177b4c8ba8000e50e59784e (diff)
downloadlibtiff-git-704f717cf5eceb70d6eca3840776c2c6ee857250.tar.gz
* libtiff/tif_predict.c: pedantic change to add explicit masking
with 0xff before casting to uchar in floating-point horizontal differencing and accumulation routines.
Diffstat (limited to 'libtiff')
-rw-r--r--libtiff/tif_predict.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libtiff/tif_predict.c b/libtiff/tif_predict.c
index b4fc5045..1388dde5 100644
--- a/libtiff/tif_predict.c
+++ b/libtiff/tif_predict.c
@@ -1,4 +1,4 @@
-/* $Id: tif_predict.c,v 1.34 2015-08-31 14:36:10 erouault Exp $ */
+/* $Id: tif_predict.c,v 1.35 2015-08-31 15:05:57 erouault Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -389,7 +389,8 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
return;
while (count > stride) {
- REPEAT4(stride, cp[stride] += cp[0]; cp++)
+ REPEAT4(stride, cp[stride] =
+ (unsigned char) ((cp[stride] + cp[0]) & 0xff); cp++)
count -= stride;
}
@@ -602,7 +603,7 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
cp = (uint8 *) cp0;
cp += cc - stride - 1;
for (count = cc; count > stride; count -= stride)
- REPEAT4(stride, cp[stride] -= cp[0]; cp--)
+ REPEAT4(stride, cp[stride] = (unsigned char)((cp[stride] - cp[0])&0xff); cp--)
}
static int