diff --git a/content/media/webaudio/AudioBufferSourceNode.cpp b/content/media/webaudio/AudioBufferSourceNode.cpp index d69af906b8de..6d77458791bd 100644 --- a/content/media/webaudio/AudioBufferSourceNode.cpp +++ b/content/media/webaudio/AudioBufferSourceNode.cpp @@ -312,6 +312,11 @@ public: mPlaybackRate = mPlaybackRateTimeline.GetValueAtTime(aStream->GetCurrentPosition()); } + // Make sure the playback rate if something our resampler can work with. + if (mPlaybackRate <= 0.0 || mPlaybackRate >= 1024) { + mPlaybackRate = 1.0; + } + uint32_t currentOutSampleRate, currentInSampleRate; if (ShouldResample()) { SpeexResamplerState* resampler = Resampler(mChannels);