diff options
author | bfriesen <bfriesen> | 2016-11-18 02:47:45 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2016-11-18 02:47:45 +0000 |
commit | f20148e4abfad0522f1ca9f090df020ad3b613db (patch) | |
tree | 2564572f3d660eb742f3c0916ca26769453b411c | |
parent | c1577027702cef55f66f23bcd2b1afd59e2770bf (diff) | |
download | libtiff-f20148e4abfad0522f1ca9f090df020ad3b613db.tar.gz |
* libtiff/tif_getimage.c: Fix some benign warnings which appear in
64-bit compilation under Microsoft Visual Studio of the form
"Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit
value. Results might not be an expected value.". Problem was
reported on November 16, 2016 on the tiff mailing list.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | libtiff/tif_getimage.c | 10 |
2 files changed, 13 insertions, 5 deletions
@@ -1,3 +1,11 @@ +2016-11-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> + + * libtiff/tif_getimage.c: Fix some benign warnings which appear in + 64-bit compilation under Microsoft Visual Studio of the form + "Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit + value. Results might not be an expected value.". Problem was + reported on November 16, 2016 on the tiff mailing list. + 2016-11-16 Even Rouault <even.rouault at spatialys.com> * libtiff/tif_dirread.c: in TIFFFetchNormalTag(), do not dereference diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c index b4e58f94..0f5e932c 100644 --- a/libtiff/tif_getimage.c +++ b/libtiff/tif_getimage.c @@ -1,4 +1,4 @@ -/* $Id: tif_getimage.c,v 1.97 2016-09-24 23:11:55 bfriesen Exp $ */ +/* $Id: tif_getimage.c,v 1.98 2016-11-18 02:47:45 bfriesen Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -1440,7 +1440,7 @@ DECLAREContigPutFunc(putRGBUAcontig8bittile) uint8* m; for (x = w; x-- > 0;) { a = pp[3]; - m = img->UaToAa+(a<<8); + m = img->UaToAa+((size_t) a<<8); r = m[pp[0]]; g = m[pp[1]]; b = m[pp[2]]; @@ -1511,7 +1511,7 @@ DECLAREContigPutFunc(putRGBUAcontig16bittile) uint8* m; for (x = w; x-- > 0;) { a = img->Bitdepth16To8[wp[3]]; - m = img->UaToAa+(a<<8); + m = img->UaToAa+((size_t) a<<8); r = m[img->Bitdepth16To8[wp[0]]]; g = m[img->Bitdepth16To8[wp[1]]]; b = m[img->Bitdepth16To8[wp[2]]]; @@ -1642,7 +1642,7 @@ DECLARESepPutFunc(putRGBUAseparate8bittile) uint8* m; for (x = w; x-- > 0;) { av = *a++; - m = img->UaToAa+(av<<8); + m = img->UaToAa+((size_t) av<<8); rv = m[*r++]; gv = m[*g++]; bv = m[*b++]; @@ -1708,7 +1708,7 @@ DECLARESepPutFunc(putRGBUAseparate16bittile) uint8* m; for (x = w; x-- > 0;) { a2 = img->Bitdepth16To8[*wa++]; - m = img->UaToAa+(a2<<8); + m = img->UaToAa+((size_t) a2<<8); r2 = m[img->Bitdepth16To8[*wr++]]; g2 = m[img->Bitdepth16To8[*wg++]]; b2 = m[img->Bitdepth16To8[*wb++]]; |