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

Unified Diff: media/filters/h264_bit_reader.cc

Issue 1886423002: Avoid left shift of negative values when parsing H264 stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: media/filters/h264_bit_reader.cc
diff --git a/media/filters/h264_bit_reader.cc b/media/filters/h264_bit_reader.cc
index 145d2e193737fd0dd196731cb134a024e204057b..4dea4000894a1e16b827c65dd432ebefb88adbe1 100644
--- a/media/filters/h264_bit_reader.cc
+++ b/media/filters/h264_bit_reader.cc
@@ -56,7 +56,7 @@ bool H264BitReader::UpdateCurrByte() {
--bytes_left_;
num_remaining_bits_in_curr_byte_ = 8;
- prev_two_bytes_ = (prev_two_bytes_ << 8) | curr_byte_;
+ prev_two_bytes_ = ((prev_two_bytes_ & 0xff) << 8) | curr_byte_;
return true;
}
« 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