ref: 42b7c44b2fa40ff8b070809e79f9931526f5fe52
parent: b1fcd1751e2b63efbb9f6b4960a42bd757e0c47e
author: Alex Converse <[email protected]>
date: Thu Nov 19 10:04:20 EST 2015
Fix a signed shift overflow in vpx_rb_read_inv_signed_literal. Found with clang -fsanitize=integer Change-Id: I17cb2166c06ff463abfaf9b0e6bc749d0d6fdf94
--- a/vpx_dsp/bitreader_buffer.c
+++ b/vpx_dsp/bitreader_buffer.c
@@ -45,7 +45,7 @@
int bits) {
#if CONFIG_MISC_FIXES
const int nbits = sizeof(unsigned) * 8 - bits - 1;
- const unsigned value = vpx_rb_read_literal(rb, bits + 1) << nbits;
+ const unsigned value = (unsigned)vpx_rb_read_literal(rb, bits + 1) << nbits;
return ((int) value) >> nbits;
#else
return vpx_rb_read_signed_literal(rb, bits);