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 c17b118ce0b354e16d2cfab42151a0127f119cf4..1919301d50bb3cabedefee29dcab40347886aca2 100644 |
--- a/webrtc/common_video/h264/h264_common.cc |
+++ b/webrtc/common_video/h264/h264_common.cc |
@@ -21,8 +21,10 @@ std::vector<NaluIndex> FindNaluIndices(const uint8_t* buffer, |
// given a 3-byte sequence we're looking at, if the 3rd byte isn't 1 or 0, |
// skip ahead to the next 3-byte sequence. 0s and 1s are relatively rare, so |
// this will skip the majority of reads/checks. |
- RTC_CHECK_GE(buffer_size, kNaluShortStartSequenceSize); |
std::vector<NaluIndex> sequences; |
+ if (buffer_size < kNaluShortStartSequenceSize) { |
tommi
2016/09/20 16:34:40
nit: no {} (see the convention below for 2-line co
|
+ return sequences; |
+ } |
const size_t end = buffer_size - kNaluShortStartSequenceSize; |
for (size_t i = 0; i < end;) { |
if (buffer[i + 2] > 1) { |