dsp/lossless.c: quiet int sanitizer warnings

in calls to Clip255(); given the current implementation's use of a
logical shift the parameter is left as uint32_t and explicit casts are
added

clears warnings of the form:
src/dsp/lossless.c:52:18: runtime error: implicit conversion
from type 'int' of value -2 (32-bit, signed) to type 'uint32_t' (aka
'unsigned int') changed the value to 4294967294 (32-bit, unsigned)

Bug: b/229626362
Change-Id: If8a7f145c2d7e62e572e221da36b04281ed5c9bf
This commit is contained in:
James Zern 2022-08-03 15:22:20 -07:00
parent 866e349cef
commit 704a3d0a1f

View File

@ -49,7 +49,7 @@ static WEBP_INLINE uint32_t Clip255(uint32_t a) {
}
static WEBP_INLINE int AddSubtractComponentFull(int a, int b, int c) {
return Clip255(a + b - c);
return Clip255((uint32_t)(a + b - c));
}
static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1,
@ -66,7 +66,7 @@ static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1,
}
static WEBP_INLINE int AddSubtractComponentHalf(int a, int b) {
return Clip255(a + (a - b) / 2);
return Clip255((uint32_t)(a + (a - b) / 2));
}
static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,