Bug 865532 - Don't attempt to stop an AudioBufferSourceNode that doesn't have a context; r=padenot
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 24 Apr 2013 22:24:25 -0400
changeset 140806 5696aa5b935410e65c61b0d15d4a25be99ae8c6b
parent 140805 a85d75cdca55c73c3b8accfbfa48f26feca1d616
child 140807 b49b5f42be79bf9290a0beca397e4ec7fbe054f4
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs865532
milestone23.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 865532 - Don't attempt to stop an AudioBufferSourceNode that doesn't have a context; r=padenot
content/media/webaudio/AudioBufferSourceNode.cpp
--- a/content/media/webaudio/AudioBufferSourceNode.cpp
+++ b/content/media/webaudio/AudioBufferSourceNode.cpp
@@ -522,17 +522,17 @@ AudioBufferSourceNode::Stop(double aWhen
 
   if (!mBuffer) {
     // We don't have a buffer, so the stream is never marked as finished.
     // Therefore we need to drop our playing ref right now.
     mPlayingRef.Drop(this);
   }
 
   AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
-  if (!ns) {
+  if (!ns || !Context()) {
     // We've already stopped and had our stream shut down
     return;
   }
 
   ns->SetStreamTimeParameter(STOP, Context()->DestinationStream(),
                              std::max(0.0, aWhen));
 }