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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc

Issue 2406363004: Don't crash on unexpected stap-a or fu-a. (Closed)
Patch Set: Created 4 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 case H264::NaluType::kAud: 522 case H264::NaluType::kAud:
523 case H264::NaluType::kEndOfSequence: 523 case H264::NaluType::kEndOfSequence:
524 case H264::NaluType::kEndOfStream: 524 case H264::NaluType::kEndOfStream:
525 case H264::NaluType::kFiller: 525 case H264::NaluType::kFiller:
526 break; 526 break;
527 case H264::NaluType::kSei: 527 case H264::NaluType::kSei:
528 parsed_payload->frame_type = kVideoFrameKey; 528 parsed_payload->frame_type = kVideoFrameKey;
529 break; 529 break;
530 case H264::NaluType::kStapA: 530 case H264::NaluType::kStapA:
531 case H264::NaluType::kFuA: 531 case H264::NaluType::kFuA:
532 RTC_NOTREACHED(); 532 LOG(LS_WARNING) << "Unexpected STAP-A or FU-A received.";
533 return false;
533 } 534 }
534 RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264; 535 RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264;
535 if (h264->nalus_length == kMaxNalusPerPacket) { 536 if (h264->nalus_length == kMaxNalusPerPacket) {
536 LOG(LS_WARNING) 537 LOG(LS_WARNING)
537 << "Received packet containing more than " << kMaxNalusPerPacket 538 << "Received packet containing more than " << kMaxNalusPerPacket
538 << " NAL units. Will not keep track sps and pps ids for all of them."; 539 << " NAL units. Will not keep track sps and pps ids for all of them.";
539 } else { 540 } else {
540 h264->nalus[h264->nalus_length++] = nalu; 541 h264->nalus[h264->nalus_length++] = nalu;
541 } 542 }
542 } 543 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 h264->packetization_type = kH264FuA; 593 h264->packetization_type = kH264FuA;
593 h264->nalu_type = original_nal_type; 594 h264->nalu_type = original_nal_type;
594 if (first_fragment) { 595 if (first_fragment) {
595 h264->nalus[h264->nalus_length] = nalu; 596 h264->nalus[h264->nalus_length] = nalu;
596 h264->nalus_length = 1; 597 h264->nalus_length = 1;
597 } 598 }
598 return true; 599 return true;
599 } 600 }
600 601
601 } // namespace webrtc 602 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698