* libtiff/tif_predict.c: pedantic change to add explicit masking

with 0xff before casting to uchar in floating-point horizontal
differencing and accumulation routines.
This commit is contained in:
Even Rouault 2015-08-31 15:05:57 +00:00
parent 45e29cce8d
commit 704f717cf5
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2015-08-31 Even Rouault <even.rouault at spatialys.com>
* libtiff/tif_predict.c: pedantic change to add explicit masking
with 0xff before casting to uchar in floating-point horizontal
differencing and accumulation routines.
2015-08-31 Even Rouault <even.rouault at spatialys.com>
* libtiff/tif_predict.c: fix generation of output with 16 bit

View File

@ -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