Bug 1195051 - Part 4: Fix a null pointer crash happening after the destination node gets CCed
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 17 Aug 2015 11:44:32 -0400
changeset 258040 36895151defddf076a922b514312336d38f84900
parent 258039 a36cd3e1092730ec25c4c7e6cf1d21b4aa645bd7
child 258041 1b61da1529722e661ff5de3c10e58a919df00b66
push id29241
push userkwierso@gmail.com
push dateTue, 18 Aug 2015 00:00:46 +0000
treeherdermozilla-central@6ae3e9ff53b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1195051
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1195051 - Part 4: Fix a null pointer crash happening after the destination node gets CCed Landed on a CLOSED TREE
dom/media/webaudio/AudioDestinationNode.cpp
--- a/dom/media/webaudio/AudioDestinationNode.cpp
+++ b/dom/media/webaudio/AudioDestinationNode.cpp
@@ -538,17 +538,22 @@ NS_IMETHODIMP
 AudioDestinationNode::WindowAudioCaptureChanged()
 {
   MOZ_ASSERT(mAudioChannelAgent);
 
   if (!mStream || Context()->IsOffline()) {
     return NS_OK;
   }
 
-  bool captured = GetOwner()->GetAudioCaptured();
+  nsCOMPtr<nsPIDOMWindow> ownerWindow = GetOwner();
+  if (!ownerWindow) {
+    return NS_OK;
+  }
+
+  bool captured = ownerWindow->GetAudioCaptured();
 
   if (captured != mCaptured) {
     if (captured) {
       nsCOMPtr<nsPIDOMWindow> window = Context()->GetParentObject();
       uint64_t id = window->WindowID();
       mCaptureStreamPort =
         mStream->Graph()->ConnectToCaptureStream(id, mStream);
     } else {