Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: content/common/gpu/media/h264_bit_reader.cc

Issue 10843057: Fix a bug that H264BitReader::ReadBits cannot read more than 16 bits. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/h264_bit_reader.cc
diff --git a/content/common/gpu/media/h264_bit_reader.cc b/content/common/gpu/media/h264_bit_reader.cc
index f2d2f356c49bab1ddde9e866f1fbf9c14ef7e3ca..64e12bee203ecfdcd34322faabbde9362d31c5f2 100644
--- a/content/common/gpu/media/h264_bit_reader.cc
+++ b/content/common/gpu/media/h264_bit_reader.cc
@@ -66,7 +66,7 @@ bool H264BitReader::ReadBits(int num_bits, int *out) {
while (num_remaining_bits_in_curr_byte_ < bits_left) {
// Take all that's left in current byte, shift to make space for the rest.
- *out = (curr_byte_ << (bits_left - num_remaining_bits_in_curr_byte_));
+ *out |= (curr_byte_ << (bits_left - num_remaining_bits_in_curr_byte_));
bits_left -= num_remaining_bits_in_curr_byte_;
if (!UpdateCurrByte())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698