Chromium Code Reviews| 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 b022b21165daa93195b1ffd638d58939498d7af5..034e761dcd4d30177d86982f47e5c8ce28508c68 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc |
| +++ b/webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc |
| @@ -36,8 +36,8 @@ 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 < byte_length_ - 3 && |
| - sps_[i] == 0 && sps_[i + 1] == 0 && sps_[i + 2] == 3) { |
| + if (i + 3 < byte_length_ && sps_[i] == 0 && sps_[i + 1] == 0 && |
|
stefan-webrtc
2015/07/01 09:59:13
Interesting bug. :)
noahric
2015/07/01 16:34:38
I think this introduced a separate bug, though you
pbos-webrtc
2015/07/01 18:12:29
So just to clarify: The bug I fixed gets hit from
noahric
2015/07/01 18:49:24
I think the most readable fix is:
if (byte_length
pbos-webrtc
2015/07/02 07:37:50
Slightly less readable in my opinion, but I won't
|
| + sps_[i + 2] == 3) { |
| // Two rbsp bytes + the emulation byte. |
| rbsp_buffer.WriteBytes(sps_bytes + i, 2); |
| i += 3; |