Bug 1260702: Don't crash on input sources from WebAudio in MediaRecorder r=padenot
authorRandell Jesup <rjesup@jesup.org>
Wed, 30 Mar 2016 10:08:04 -0400
changeset 291072 1fd5dcb62bc4be26d7de019bb978fd7970953f9b
parent 291071 dc32b86990d5142169d46d9b1ac75c780d99442c
child 291073 57a583c7c3107d396c1c5a51bc7a248c452f21a7
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1260702
milestone48.0a1
Bug 1260702: Don't crash on input sources from WebAudio in MediaRecorder r=padenot MozReview-Commit-ID: cseol6STUw
dom/media/MediaRecorder.cpp
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -638,17 +638,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.