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

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 2270793003: NetEq: only update current_rtp_payload_type_ when validated (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@neteq-fuzz-fix1
Patch Set: Fix review comment Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/neteq_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index e65466f6d83a28081d909fc3c49e8c69bc66dc69..78e31121848d166826239086835678c051280cd7 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -598,7 +598,6 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
// Update codecs.
timestamp_ = main_header.timestamp;
- current_rtp_payload_type_ = main_header.payloadType;
// Reset timestamp scaling.
timestamp_scaler_->Reset();
@@ -744,13 +743,10 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
new_codec_ = true;
}
- if (current_rtp_payload_type_ != 0xFF) {
- const DecoderDatabase::DecoderInfo* dec_info =
- decoder_database_->GetDecoderInfo(current_rtp_payload_type_);
- if (!dec_info) {
- assert(false); // Already checked that the payload type is known.
- }
- }
+ RTC_DCHECK(current_rtp_payload_type_ == 0xFF ||
+ decoder_database_->GetDecoderInfo(current_rtp_payload_type_))
+ << "Payload type " << static_cast<int>(current_rtp_payload_type_)
+ << " is unknown where it shouldn't be";
if (update_sample_rate_and_channels && !packet_buffer_->Empty()) {
// We do not use |current_rtp_payload_type_| to |set payload_type|, but
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/neteq_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698