Bug 1447982 - Guard against destroyed stream. r?padenot draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Mar 2018 10:57:36 +0200
changeset 781064 fa13296ec0e85b1f08496b1174f8fff6762832dc
parent 781063 86652814519f1a0ae473119ec1f38fe2b69e2dc6
child 781065 6dde31441b6b0c677f1f21b52a3a4e2eb1ae0244
push id106197
push userbmo:apehrson@mozilla.com
push dateThu, 12 Apr 2018 13:32:52 +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