Bug 869684 - Don't crash if the last output chunk for a given stream doesn't contain any channels; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 07 May 2013 23:31:55 -0400
changeset 142167 d8b87a58ebf51a6348a3f1c23eeef97621d72c96
parent 142166 f5669ac3bf3663459ed7688dc45291d7482e3a3e
child 142168 657d4cb2ea1705278cac10f525aba147d501afa9
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)
reviewersroc
bugs869684
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 869684 - Don't crash if the last output chunk for a given stream doesn't contain any channels; r=roc X-Git-Commit-ID: 4c3b39a6049471e6b731369653eafb83efebcf1b X-Mailer: git-send-email
content/media/AudioNodeStream.cpp
--- a/content/media/AudioNodeStream.cpp
+++ b/content/media/AudioNodeStream.cpp
@@ -276,17 +276,18 @@ AudioNodeStream::ObtainInputBlock(AudioC
     outputChannelCount = std::min(outputChannelCount, mNumberOfInputChannels);
     break;
   case ChannelCountMode::Max:
     // Nothing to do here, just shut up the compiler warning.
     break;
   }
 
   uint32_t inputChunkCount = inputChunks.Length();
-  if (inputChunkCount == 0) {
+  if (inputChunkCount == 0 ||
+      (inputChunkCount == 1 && inputChunks[0]->mChannelData.Length() == 0)) {
     aTmpChunk.SetNull(WEBAUDIO_BLOCK_SIZE);
     return;
   }
 
   if (inputChunkCount == 1 &&
       inputChunks[0]->mChannelData.Length() == outputChannelCount) {
     aTmpChunk = *inputChunks[0];
     return;