]> granicus.if.org Git - libvpx/commitdiff
vpx_dsp/bitwriter.h: fix clang integer sanitizer warning
authorHien Ho <hienho@google.com>
Thu, 20 Jun 2019 16:40:46 +0000 (09:40 -0700)
committerHien Ho <hienho@google.com>
Wed, 31 Jul 2019 16:05:36 +0000 (16:05 +0000)
implicit conversion from type 'unsigned int' of value 256 (32-bit, unsigned)
to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned)

BUG=webm:1615

Change-Id: Ia9ac3772021ae492368c650a73846e7d22c8fdfc

vpx_dsp/bitwriter.h

index f276feefb1da3c246733f6ee700fd8cc46d1a990..04084af8f25a2ad9b4a1bfa9a23617a9a7d4ee85 100644 (file)
@@ -85,7 +85,7 @@ static INLINE void vpx_write(vpx_writer *br, int bit, int probability) {
       br->buffer[x] += 1;
     }
 
-    br->buffer[br->pos++] = (lowvalue >> (24 - offset));
+    br->buffer[br->pos++] = (lowvalue >> (24 - offset)) & 0xff;
     lowvalue <<= offset;
     shift = count;
     lowvalue &= 0xffffff;