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

Unified Diff: webrtc/common_video/h264/h264_common.cc

Issue 2471973003: Allow H264 bitstream parser to fail gracefully (Closed)
Patch Set: Created 4 years, 1 month 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 | « webrtc/common_video/h264/h264_bitstream_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/h264/h264_common.cc
diff --git a/webrtc/common_video/h264/h264_common.cc b/webrtc/common_video/h264/h264_common.cc
index fe55b02d2cc246bba59da20931d7ff73a1b38626..a9cc6a25e62882e8619ed627aeb9cefee67e248f 100644
--- a/webrtc/common_video/h264/h264_common.cc
+++ b/webrtc/common_video/h264/h264_common.cc
@@ -24,6 +24,7 @@ std::vector<NaluIndex> FindNaluIndices(const uint8_t* buffer,
std::vector<NaluIndex> sequences;
if (buffer_size < kNaluShortStartSequenceSize)
return sequences;
+
const size_t end = buffer_size - kNaluShortStartSequenceSize;
for (size_t i = 0; i < end;) {
if (buffer[i + 2] > 1) {
« no previous file with comments | « webrtc/common_video/h264/h264_bitstream_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698