WebAudio: limit output level to 0db
https://bugs.webkit.org/show_bug.cgi?id=95792
<rdar://problem/
11966135>
Reviewed by Chris Rogers.
.:
Add a manual test to determine that output volume has been limited to 0db.
* ManualTests/webaudio/limit-level-0db.html: Added.
Source/WebCore:
Clamp the output buffer data to the range of [-1,1], which limits
output volume to 0db. This ensures that malicious or poorly-written
pages will not be able to blow through the system volume limit by
creating >0db buffers and effects.
No new tests; added ManualTests/webaudio/limit-level-0db.html.
Clamp the output vector to values of [-1,1]:
* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestinationMac::render):
Add a VectorMath wrapper for vDSP_clip to provide accelerated vector threshold operations:
* platform/audio/VectorMath.h:
* platform/audio/VectorMath.cpp:
(VectorMath):
(WebCore::VectorMath::vclip):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131459
268f45cc-cd09-0410-ab3c-
d52691b4dbfc