Index: webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc b/webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc |
index 034e761dcd4d30177d86982f47e5c8ce28508c68..9f76ccf646e5f6fe918608f94fdc6525355082f9 100644 |
--- a/webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc |
+++ b/webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc |
@@ -36,7 +36,7 @@ bool H264SpsParser::Parse() { |
// section 7.3.1 of the H.264 standard. |
rtc::ByteBuffer rbsp_buffer; |
for (size_t i = 0; i < byte_length_;) { |
- if (i + 3 < byte_length_ && sps_[i] == 0 && sps_[i + 1] == 0 && |
+ if (byte_length_ - i >= 3 && sps_[i] == 0 && sps_[i + 1] == 0 && |
pbos-webrtc
2015/07/09 09:20:07
Can you put a comment here saying that we check (b
|
sps_[i + 2] == 3) { |
// Two rbsp bytes + the emulation byte. |
rbsp_buffer.WriteBytes(sps_bytes + i, 2); |