Throw exceptions for invalid number of channels for ConvolverNode
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jul 2016 04:11:44 +0000 (04:11 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jul 2016 04:11:44 +0000 (04:11 +0000)
commit4c13f34ac9d398786ff16afdf199a4bf5b9be904
tree139faf881915178024d42e9e86b13542d3f44cc5
parentd397d017eddf1ada191f4368917b224a193836d3
Throw exceptions for invalid number of channels for ConvolverNode
<https://webkit.org/b/159238>

Patch by David Kilzer <ddkilzer@apple.com> on 2016-07-05
Reviewed by Brent Fulgham.

Source/WebCore:

Fix based on a Blink change (patch by <rtoy@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>

Also includes a related fix for ReverbConvolverStage (patch by <rtoy@chromium.org>):
<https://src.chromium.org/viewvc/blink?revision=157832&view=revision>

Test: webaudio/convolver-channels.html

* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::setBuffer): Throw an exception for
anything but 1, 2 or 4 channels.
* platform/audio/ReverbConvolverStage.cpp:
(WebCore::ReverbConvolverStage::ReverbConvolverStage): Don't read past the end of
the impulseResponse array.

LayoutTests:

Test based on a Blink change (patch by <rtoy@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>

compatibility.js based on a Blink change (patch by <rtoy@google.com>):
<https://chromium.googlesource.com/chromium/src.git/+/f846f5a461d1fcdbe5152898576c125058079ed1>

* webaudio/convolver-channels-expected.txt: Added.
* webaudio/convolver-channels.html: Added.
* webaudio/resources/compatibility.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webaudio/convolver-channels-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/convolver-channels.html [new file with mode: 0644]
LayoutTests/webaudio/resources/compatibility.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/ConvolverNode.cpp
Source/WebCore/platform/audio/ReverbConvolverStage.cpp