shithub: libvpx

Download patch

ref: 9062b92b0fb9e49fbe22ad844abdfaf9f86530dd
parent: 395ae7abed0c5cf8ba62c37d06eb474c0df621e1
parent: c003b97d11e714b5fdca6657e7f57413a9514007
author: Jim Bankoski <[email protected]>
date: Thu Jun 6 13:13:57 EDT 2013

Merge "fix vp9_wb_write_bit uninitialized variable" into experimental

--- a/vp9/encoder/vp9_write_bit_buffer.h
+++ b/vp9/encoder/vp9_write_bit_buffer.h
@@ -26,8 +26,12 @@
   const int off = wb->bit_offset;
   const int p = off / CHAR_BIT;
   const int q = CHAR_BIT - 1 - off % CHAR_BIT;
-  wb->bit_buffer[p] &= ~(1 << q);
-  wb->bit_buffer[p] |= bit << q;
+  if (q == CHAR_BIT -1) {
+    wb->bit_buffer[p] = bit << q;
+  } else {
+    wb->bit_buffer[p] &= ~(1 << q);
+    wb->bit_buffer[p] |= bit << q;
+  }
   wb->bit_offset = off + 1;
 }