From 2e672351aa5a510092fd1d687798716f99e173d0 Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 25 May 2019 12:31:09 -0700 Subject: [PATCH] bit_writer_utils,Flush: quiet implicit conversion warnings no change in object code from clang-7 -fsanitize=implicit-integer-truncation implicit conversion from type 'int32_t' (aka 'int') of value 287 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 31 (8-bit, unsigned) Change-Id: I692368bcc2f41412697b8ae51e53078831072891 --- src/utils/bit_writer_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/bit_writer_utils.c b/src/utils/bit_writer_utils.c index 7f83b4c8..bef0e31c 100644 --- a/src/utils/bit_writer_utils.c +++ b/src/utils/bit_writer_utils.c @@ -70,7 +70,7 @@ static void Flush(VP8BitWriter* const bw) { const int value = (bits & 0x100) ? 0x00 : 0xff; for (; bw->run_ > 0; --bw->run_) bw->buf_[pos++] = value; } - bw->buf_[pos++] = bits; + bw->buf_[pos++] = bits & 0xff; bw->pos_ = pos; } else { bw->run_++; // delay writing of bytes 0xff, pending eventual carry.