Bug 1447982 - Guard against destroyed stream. r=padenot
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Mar 2018 10:57:36 +0200
changeset 781467 509e08753980576fc402bce0894742138e82f013
parent 781466 b9533a2015d5093396b48cd44cd189436c6cb2a4
child 781468 5ce4dd0d0ca5b075ac1008e505df64bbdfc76df5
push id106312
push userhaftandilian@mozilla.com
push dateThu, 12 Apr 2018 23:43:57 +0000
reviewerspadenot
bugs1447982
milestone61.0a1
Bug 1447982 - Guard against destroyed stream. r=padenot MozReview-Commit-ID: 51opeU1U6GR
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -471,17 +471,17 @@ MediaEngineWebRTCMicrophoneSource::Updat
       }
 
       if (prefs.mChannels != mLastPrefs.mChannels) {
         // If the channel count changed, tell the MSG to open a new driver with
         // the correct channel count.
         MOZ_ASSERT(!mAllocations.IsEmpty());
         RefPtr<SourceMediaStream> stream;
         for (const Allocation& allocation : mAllocations) {
-          if (allocation.mStream) {
+          if (allocation.mStream && allocation.mStream->GraphImpl()) {
             stream = allocation.mStream;
             break;
           }
         }
         MOZ_ASSERT(stream);
 
         mAudioInput->SetUserChannelCount(prefs.mChannels);
         // Get validated number of channel