diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc index 72a72bf43e..a93977d6d9 100644 --- a/talk/app/webrtc/webrtcsdp.cc +++ b/talk/app/webrtc/webrtcsdp.cc @@ -1770,6 +1770,8 @@ void BuildCandidate(const std::vector& candidates, type = kCandidateRelay; } else { ASSERT(false); + // Never write out candidates if we don't know the type. + continue; } InitAttrLine(kAttributeCandidate, &os); diff --git a/webrtc/p2p/base/transport.cc b/webrtc/p2p/base/transport.cc index dfc7d34b43..df452fdf31 100644 --- a/webrtc/p2p/base/transport.cc +++ b/webrtc/p2p/base/transport.cc @@ -559,6 +559,12 @@ void Transport::OnChannelRequestSignaling_s() { void Transport::OnChannelCandidateReady(TransportChannelImpl* channel, const Candidate& candidate) { + // We should never signal peer-reflexive candidates. + if (candidate.type() == PRFLX_PORT_TYPE) { + ASSERT(false); + return; + } + ASSERT(worker_thread()->IsCurrent()); rtc::CritScope cs(&crit_); ready_candidates_.push_back(candidate);