shithub: libvpx

Download patch

ref: 36a0c7ffe3ec21d3f84bd9ec1f913a62d6215d3a
parent: b2ccb9c189069d45d201c988184e9e0796b96270
author: Alex Converse <[email protected]>
date: Thu Nov 19 11:09:03 EST 2015

bitreader: remove an unsigned overflow.

bits_left is in the range [0, 64 (= BD_VALUE_SIZE)] , so the narrowing
conversion should be safe.

Change-Id: I943fcd359eaad76249ee1e1fb03a2ac16945d2fd

--- a/vpx_dsp/bitreader.c
+++ b/vpx_dsp/bitreader.c
@@ -69,7 +69,7 @@
       buffer += (bits >> 3);
       value = r->value | (nv << (shift & 0x7));
   } else {
-    const int bits_over = (int)(shift + CHAR_BIT - bits_left);
+    const int bits_over = (int)(shift + CHAR_BIT - (int)bits_left);
     int loop_end = 0;
     if (bits_over >= 0) {
       count += LOTS_OF_BITS;