Bug 876834 - Do not accept sampling rates which we won't be able to handle when creating an OfflineAudioContext; r=roc

This commit is contained in:
Ehsan Akhgari 2013-05-29 00:10:52 -04:00
parent f8dd46986c
commit 042b85c631
3 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<script>
OfflineAudioContext(0, 0, 3229622);
</script>

View File

@ -24,3 +24,4 @@ load 875596.html
load 875911.html load 875911.html
load 876249.html load 876249.html
load 876252.html load 876252.html
load 876834.html

View File

@ -109,7 +109,7 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
return nullptr; return nullptr;
} }
if (aSampleRate <= 0.0f) { if (aSampleRate <= 0.0f || aSampleRate >= TRACK_RATE_MAX) {
// The DOM binding protects us against infinity and NaN // The DOM binding protects us against infinity and NaN
aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
return nullptr; return nullptr;