Bug 1264479: don't crash on disappearing data channels. r=bwc
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Thu, 31 Aug 2017 14:30:50 -0700
changeset 428446 b2c6734e843ec03e189438e5b44eae2de7d5db1c
parent 428445 6aa9cedf2be01646f1d4b22b21e0c347deb2ae4a
child 428447 08d59706aac1fc2adaa4839e9db8c04e00bc121b
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1264479
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1264479: don't crash on disappearing data channels. r=bwc MozReview-Commit-ID: 3DmM7teByR8
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -1979,16 +1979,21 @@ PeerConnectionImpl::RemoveOldRemoteTrack
 
   std::vector<RefPtr<JsepTrack>> removedTracks =
     mJsepSession->GetRemoteTracksRemoved();
 
   for (auto& removedTrack : removedTracks) {
     const std::string& streamId = removedTrack->GetStreamId();
     const std::string& trackId = removedTrack->GetTrackId();
 
+    if (removedTrack->GetMediaType() == SdpMediaSection::kApplication) {
+      // TODO do we need to notify content somehow here?
+      continue;
+    }
+
     RefPtr<RemoteSourceStreamInfo> info = mMedia->GetRemoteStreamById(streamId);
     if (!info) {
       MOZ_ASSERT(false, "A stream/track was removed that wasn't in PCMedia. "
                         "This is a bug.");
       continue;
     }
 
     mMedia->RemoveRemoteTrack(streamId, trackId);