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 310373 c9d25791f8219540e527c3d18aa919418fff4061
parent 310372 b5878f102851ebe591f540eb97e567a9aed8f7d9
child 310374 d6e5c2d3afe9105fabb817744788dbc08f13543a
push id9343
push userrjesup@wgate.com
push dateFri, 01 Apr 2016 03:34:46 +0000
treeherdermozilla-aurora@c9d25791f821 [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.