From a24213691616e7cd35aa3e2805493de80c7e4fcf Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 11 Feb 2019 23:56:05 +0100 Subject: [PATCH] tiff2ps.c: fix warning caused by integer promotion uint8 value is promoted to int in (value << 24) so -fsanitize yield runtime errors : tiff2ps.c:2969:33: runtime error: left shift of 246 by 24 places cannot be represented in type 'int' --- tools/tiff2ps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c index a5b943ec..0875b583 100644 --- a/tools/tiff2ps.c +++ b/tools/tiff2ps.c @@ -2966,10 +2966,10 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw for ( ; raw_l > 3; raw_l -= 4 ) { - val32 = *(++raw_p) << 24; - val32 += *(++raw_p) << 16; - val32 += *(++raw_p) << 8; - val32 += *(++raw_p); + val32 = (uint32)*(++raw_p) << 24; + val32 += (uint32)*(++raw_p) << 16; + val32 += (uint32)*(++raw_p) << 8; + val32 += (uint32)*(++raw_p); if ( val32 == 0 ) /* Special case */ {