Passing invalid values to OfflineAudioContext's constructor should not crash.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Feb 2015 21:10:13 +0000 (21:10 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Feb 2015 21:10:13 +0000 (21:10 +0000)
commit6a6e574a1baefda7f27ed532f7d2135f5cec1146
treea55dd578eba8b408dd6ebeb2a74b56553ea1ecf1
parentec709e2194ff6611526da376698046d4bfaa664d
Passing invalid values to OfflineAudioContext's constructor should not crash.
https://bugs.webkit.org/show_bug.cgi?id=141197

Reviewed by Darin Adler.

Source/WebCore:

Test: webaudio/offlineaudiocontext-constructor.html

Throw a SYNTAX_ERR exception if passed in a zero for channelCount or numberOfSamples. This avoids
a crash where OfflineAudioDestinationNode is passed a null renderTarget.

* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::create):

LayoutTests:

* webaudio/offlineaudiocontext-constructor-expected.txt: Added.
* webaudio/offlineaudiocontext-constructor.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webaudio/offlineaudiocontext-constructor-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/offlineaudiocontext-constructor.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp