Bug 1447982 - Guard against destroyed stream. r?padenot
MozReview-Commit-ID: 51opeU1U6GR
--- 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