Check number of nalus in packet before checking nalu types.

Bug: chromium:840536
Change-Id: Ia4dcf322ad6290691fd01b58fb02cd868714c92e
Reviewed-on: https://webrtc-review.googlesource.com/77121
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23283}
This commit is contained in:
philipel
2018-05-17 14:11:09 +02:00
committed by Commit Bot
parent 1e9cf7faf8
commit 09133af36f
2 changed files with 49 additions and 0 deletions

View File

@ -306,6 +306,10 @@ std::vector<std::unique_ptr<RtpFrameObject>> PacketBuffer::FindFrames(
if (is_h264 && !is_h264_keyframe) {
const RTPVideoHeaderH264& header =
data_buffer_[start_index].video_header.codecHeader.H264;
if (header.nalus_length >= kMaxNalusPerPacket)
return found_frames;
for (size_t j = 0; j < header.nalus_length; ++j) {
if (header.nalus[j].type == H264::NaluType::kSps) {
has_h264_sps = true;