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

Unified Diff: media/filters/h264_bit_reader.cc

Issue 1865203002: Avoid integer overflow errors when parsing Exp-Golomb codes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more 1u 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 | media/filters/h264_parser.cc » ('j') | media/filters/h264_parser.cc » ('J')
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 5b009a18281408ad4345e529e706de959a1bb5f8..145d2e193737fd0dd196731cb134a024e204057b 100644
--- a/media/filters/h264_bit_reader.cc
+++ b/media/filters/h264_bit_reader.cc
@@ -79,7 +79,7 @@ bool H264BitReader::ReadBits(int num_bits, int* out) {
}
*out |= (curr_byte_ >> (num_remaining_bits_in_curr_byte_ - bits_left));
- *out &= ((1 << num_bits) - 1);
+ *out &= ((1u << num_bits) - 1u);
num_remaining_bits_in_curr_byte_ -= bits_left;
return true;
« no previous file with comments | « no previous file | media/filters/h264_parser.cc » ('j') | media/filters/h264_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698