Bug 917260 - Nullcheck Destination() in AudioContext::DestinationStream. r=ehsan, a=akeybl
authorPaul Adenot <paul@paul.cx>
Tue, 17 Sep 2013 15:23:52 +0200
changeset 154100 902feb79b47748befcc3d7bdbd579632fb17ae68
parent 154099 b6af3891f9fc4cccaaf687d09a0d8ea4dfd94def
child 154101 859717cd6229961e63567854f0d03113e6058917
push id2876
push userryanvm@gmail.com
push dateMon, 23 Sep 2013 20:35:59 +0000
treeherdermozilla-beta@b09d09f59611 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, akeybl
bugs917260
milestone25.0
Bug 917260 - Nullcheck Destination() in AudioContext::DestinationStream. r=ehsan, a=akeybl
content/media/webaudio/AudioContext.cpp
--- a/content/media/webaudio/AudioContext.cpp
+++ b/content/media/webaudio/AudioContext.cpp
@@ -505,17 +505,20 @@ MediaStreamGraph*
 AudioContext::Graph() const
 {
   return Destination()->Stream()->Graph();
 }
 
 MediaStream*
 AudioContext::DestinationStream() const
 {
-  return Destination()->Stream();
+  if (Destination()) {
+    return Destination()->Stream();
+  }
+  return nullptr;
 }
 
 double
 AudioContext::CurrentTime() const
 {
   return MediaTimeToSeconds(Destination()->Stream()->GetCurrentTime());
 }