Bug 1275648: check return value of GetPipelineByTrackId_m. r=jesup, a=sylvestre
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Wed, 25 May 2016 10:32:29 -0700
changeset 333187 3ddc3cdbc52d1335b68d9894fba2bfe857d92883
parent 333186 4854209add13c9aad1a44b6eee8e31b3051dde0e
child 333188 34b32f5cb229db6eafbdaa653d079be1a6ca007e
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, sylvestre
bugs1275648
milestone48.0a2
Bug 1275648: check return value of GetPipelineByTrackId_m. r=jesup, a=sylvestre MozReview-Commit-ID: EtJSbok04Lc
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -1437,19 +1437,21 @@ void RemoteSourceStreamInfo::UpdatePrinc
   // accessible to the script principal.
   for (auto& trackPair : mTracks) {
     MOZ_RELEASE_ASSERT(trackPair.second);
     RemoteTrackSource& source =
       static_cast<RemoteTrackSource&>(trackPair.second->GetSource());
     source.SetPrincipal(aPrincipal);
 
     RefPtr<MediaPipeline> pipeline = GetPipelineByTrackId_m(trackPair.first);
-    MOZ_ASSERT(pipeline->direction() == MediaPipeline::RECEIVE);
-    static_cast<MediaPipelineReceive*>(pipeline.get())
-      ->SetPrincipalHandle_m(MakePrincipalHandle(aPrincipal));
+    if (pipeline) {
+      MOZ_ASSERT(pipeline->direction() == MediaPipeline::RECEIVE);
+      static_cast<MediaPipelineReceive*>(pipeline.get())
+        ->SetPrincipalHandle_m(MakePrincipalHandle(aPrincipal));
+    }
   }
 }
 #endif // MOZILLA_INTERNAL_API
 
 bool
 PeerConnectionMedia::AnyCodecHasPluginID(uint64_t aPluginID)
 {
   for (uint32_t i=0; i < mLocalSourceStreams.Length(); ++i) {