From 3a9a4d458939934b2a041f4d7af4935182ce88a5 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 3 Aug 2022 15:27:39 -0700 Subject: [PATCH] VP8GetSigned: clear int sanitizer warnings clears warnings of the form: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned) Bug: b/229626362 Change-Id: I956671d4fee482c97c67bbe94032a97da49b0f6d --- src/utils/bit_reader_inl_utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/bit_reader_inl_utils.h b/src/utils/bit_reader_inl_utils.h index 404b9a6d..24f3af7b 100644 --- a/src/utils/bit_reader_inl_utils.h +++ b/src/utils/bit_reader_inl_utils.h @@ -148,9 +148,9 @@ int VP8GetSigned(VP8BitReader* WEBP_RESTRICT const br, int v, const range_t value = (range_t)(br->value_ >> pos); const int32_t mask = (int32_t)(split - value) >> 31; // -1 or 0 br->bits_ -= 1; - br->range_ += mask; + br->range_ += (range_t)mask; br->range_ |= 1; - br->value_ -= (bit_t)((split + 1) & mask) << pos; + br->value_ -= (bit_t)((split + 1) & (uint32_t)mask) << pos; BT_TRACK(br); return (v ^ mask) - mask; }