Bug 1260702: Don't crash on input sources from WebAudio in MediaRecorder r=padenot a=ritu
authorRandell Jesup <rjesup@jesup.org>
Wed, 30 Mar 2016 10:08:04 -0400
changeset 323736 c9d25791f8219540e527c3d18aa919418fff4061
parent 323735 b5878f102851ebe591f540eb97e567a9aed8f7d9
child 323737 d6e5c2d3afe9105fabb817744788dbc08f13543a
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, ritu
bugs1260702
milestone47.0a2
Bug 1260702: Don't crash on input sources from WebAudio in MediaRecorder r=padenot a=ritu MozReview-Commit-ID: cseol6STUw
dom/media/MediaRecorder.cpp
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -634,17 +634,17 @@ private:
     if (!mTrackUnionStream) {
       LOG(LogLevel::Debug, ("Session.InitEncoder !mTrackUnionStream %p", this));
       DoSessionEndTask(NS_OK);
       return;
     }
     mTrackUnionStream->AddListener(mEncoder);
     // Try to use direct listeners if possible
     DOMMediaStream* domStream = mRecorder->Stream();
-    if (domStream) {
+    if (domStream && domStream->GetInputStream()) {
       mInputStream = domStream->GetInputStream()->AsSourceStream();
       if (mInputStream) {
         mInputStream->AddDirectListener(mEncoder);
         mEncoder->SetDirectConnect(true);
       }
     }
 
     // Create a thread to read encode media data from MediaEncoder.