Bug 877820 - Improve the argument checking for OfflineAudioContext's sampleRate argument; r=roc

This commit is contained in:
Ehsan Akhgari 2013-05-30 20:54:07 -04:00
parent cfd4629d99
commit 81dc335548
3 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,4 @@
<script>
o1 = new window.OfflineAudioContext(2, 5, 0.39);
window.location.reload();
</script>

View File

@ -30,3 +30,4 @@ load 876215.html
load 876249.html
load 876252.html
load 876834.html
load 877820.html

View File

@ -106,7 +106,7 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
if (aNumberOfChannels == 0 ||
aNumberOfChannels > WebAudioUtils::MaxChannelCount ||
aLength == 0 ||
aSampleRate <= 0.0f ||
aSampleRate <= 1.0f ||
aSampleRate >= TRACK_RATE_MAX) {
// The DOM binding protects us against infinity and NaN
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);