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

Unified Diff: webrtc/modules/video_coding/utility/vp8_header_parser.cc

Issue 1888313002: Fix the issue of undefined-shift in VP8GetBit. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: use RTC_CHECK_GE 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: webrtc/modules/video_coding/utility/vp8_header_parser.cc
diff --git a/webrtc/modules/video_coding/utility/vp8_header_parser.cc b/webrtc/modules/video_coding/utility/vp8_header_parser.cc
index 631385d0f25095903e676f79dc24e04ea1e1c6cd..180b555c57adaf5224eda065bb6215bc07ec5caa 100644
--- a/webrtc/modules/video_coding/utility/vp8_header_parser.cc
+++ b/webrtc/modules/video_coding/utility/vp8_header_parser.cc
@@ -7,9 +7,10 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/modules/video_coding/utility/vp8_header_parser.h"
+#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
pbos-webrtc 2016/04/18 15:10:14 These should go below where they were, vp8_header_
jackychen_ 2016/04/18 19:18:17 Done.
+#include "webrtc/modules/video_coding/utility/vp8_header_parser.h"
namespace webrtc {
@@ -75,7 +76,7 @@ static int VP8GetBit(VP8BitReader* const br, int prob) {
if (br->bits_ < 0) {
VP8LoadNewBytes(br);
}
-
+ RTC_CHECK_GE(br->bits_, 0);
pbos-webrtc 2016/04/18 15:10:14 You can't use this for network data. We cannot cra
jackychen_ 2016/04/18 19:18:17 When VP8GetBit read invalid bitstream, it should p
const int pos = br->bits_;
const uint8_t split = (range * prob) >> 8;
const uint8_t value = static_cast<uint8_t>(br->value_ >> pos);
« 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