From e2fecc22e1d758e58c2c041dee27b397c799622e Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 8 Aug 2022 13:33:44 -0700 Subject: [PATCH] dsp/lossless_enc.c: clear int sanitizer warnings in TransformColorBlue; make new_blue an int to avoid: implicit conversion from type 'int' of value 264 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 8 (8-bit, unsigned) Bug: b/229626362 Change-Id: Ife276a59231075788396204e1a192f3b0c6d9e21 --- src/dsp/lossless_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dsp/lossless_enc.c b/src/dsp/lossless_enc.c index 27a612fc..b1f9f26d 100644 --- a/src/dsp/lossless_enc.c +++ b/src/dsp/lossless_enc.c @@ -569,7 +569,7 @@ static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, uint32_t argb) { const int8_t green = U32ToS8(argb >> 8); const int8_t red = U32ToS8(argb >> 16); - uint8_t new_blue = argb & 0xff; + int new_blue = argb & 0xff; new_blue -= ColorTransformDelta((int8_t)green_to_blue, green); new_blue -= ColorTransformDelta((int8_t)red_to_blue, red); return (new_blue & 0xff);