bitreader/writer: Change shift to signed

Silences several legal but suspicious unsigned overflows found with
clang -fsanitize=integer.

Change-Id: I69399751492a183167932b0a10751c433c32ca7b
This commit is contained in:
Alex Converse 2015-11-19 15:07:55 -08:00
parent 42b7c44b2f
commit 6aa2163b69
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ static INLINE int vpx_read(vpx_reader *r, int prob) {
}
{
register unsigned int shift = vpx_norm[range];
register int shift = vpx_norm[range];
range <<= shift;
value <<= shift;
count -= shift;

View File

@ -35,7 +35,7 @@ static INLINE void vpx_write(vpx_writer *br, int bit, int probability) {
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);