Add safeguards against signalling peer-reflexive candidates.

BUG=4208
R=juberti@google.com

Review URL: https://webrtc-codereview.appspot.com/50799004

Cr-Commit-Position: refs/heads/master@{#9104}
diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc
index 72a72bf..a93977d 100644
--- a/talk/app/webrtc/webrtcsdp.cc
+++ b/talk/app/webrtc/webrtcsdp.cc
@@ -1770,6 +1770,8 @@
       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 dfc7d34..df452fd 100644
--- a/webrtc/p2p/base/transport.cc
+++ b/webrtc/p2p/base/transport.cc
@@ -559,6 +559,12 @@
 
 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);