Bug 1221855 - null-check mInputBuffer in SizeOfExcludingThis(). r=padenot, a=lizzard
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 06 Nov 2015 15:00:17 +1300
changeset 296730 294b55e22276
parent 296729 93d92b8c2b6c
child 296731 844ff2b4f267
push id5312
push usercbook@mozilla.com
push date2015-11-16 08:13 +0000
treeherdermozilla-beta@844ff2b4f267 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, lizzard
bugs1221855
milestone43.0
Bug 1221855 - null-check mInputBuffer in SizeOfExcludingThis(). r=padenot, a=lizzard
dom/media/webaudio/ScriptProcessorNode.cpp
--- a/dom/media/webaudio/ScriptProcessorNode.cpp
+++ b/dom/media/webaudio/ScriptProcessorNode.cpp
@@ -335,17 +335,19 @@ public:
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     // Not owned:
     // - mSource (probably)
     // - mDestination (probably)
     size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
     amount += mSharedBuffers->SizeOfIncludingThis(aMallocSizeOf);
-    amount += mInputBuffer->SizeOfIncludingThis(aMallocSizeOf);
+    if (mInputBuffer) {
+      amount += mInputBuffer->SizeOfIncludingThis(aMallocSizeOf);
+    }
 
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }