ref: 6aa2163b6975872cab3f326218cfadf01ee2a78c
parent: 42b7c44b2fa40ff8b070809e79f9931526f5fe52
author: Alex Converse <[email protected]>
date: Thu Nov 19 10:07:55 EST 2015
bitreader/writer: Change shift to signed Silences several legal but suspicious unsigned overflows found with clang -fsanitize=integer. Change-Id: I69399751492a183167932b0a10751c433c32ca7b
--- a/vpx_dsp/bitreader.h
+++ b/vpx_dsp/bitreader.h
@@ -98,7 +98,7 @@
}
{
- register unsigned int shift = vpx_norm[range];
+ register int shift = vpx_norm[range];
range <<= shift;
value <<= shift;
count -= shift;
--- a/vpx_dsp/bitwriter.h
+++ b/vpx_dsp/bitwriter.h
@@ -35,7 +35,7 @@
int count = br->count;
unsigned int range = br->range;
unsigned int lowvalue = br->lowvalue;
- register unsigned int shift;
+ register int shift;
split = 1 + (((range - 1) * probability) >> 8);