diff options
author | Even Rouault <even.rouault@spatialys.com> | 2020-02-26 21:20:10 +0000 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2020-02-26 21:20:10 +0000 |
commit | e9a124f52ff3669b7201ca10f8b96e392993148e (patch) | |
tree | 2c9b60343158314d821950e4601e82f6c5d207fb | |
parent | a7276b9198648db47e6c51fd47b6fc4345f3ec88 (diff) | |
parent | 4f168b7368eaab89d803ae9527016d527ed83713 (diff) | |
download | libtiff-git-e9a124f52ff3669b7201ca10f8b96e392993148e.tar.gz |
Merge branch 'int-shift' into 'master'
tiffcrop: fix asan runtime error caused by integer promotion
See merge request libtiff/libtiff!105
-rw-r--r-- | tools/tiffcrop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c index 29c19a2f..6cc5a2ce 100644 --- a/tools/tiffcrop.c +++ b/tools/tiffcrop.c @@ -4024,9 +4024,9 @@ combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols, { src = in[s] + src_offset + src_byte; if (little_endian) - buff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + buff1 = ((uint32)src[0] << 24) | ((uint32)src[1] << 16) | ((uint32)src[2] << 8) | (uint32)src[3]; else - buff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + buff1 = ((uint32)src[3] << 24) | ((uint32)src[2] << 16) | ((uint32)src[1] << 8) | (uint32)src[0]; buff1 = (buff1 & matchbits) << (src_bit); /* If we have a full buffer's worth, write it out */ |