Changeset 202845 in webkit
- Timestamp:
- Jul 5, 2016 9:11:44 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202843 r202845 1 2016-07-05 David Kilzer <ddkilzer@apple.com> 2 3 Throw exceptions for invalid number of channels for ConvolverNode 4 <https://webkit.org/b/159238> 5 6 Reviewed by Brent Fulgham. 7 8 Test based on a Blink change (patch by <rtoy@chromium.org>): 9 <https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5> 10 11 compatibility.js based on a Blink change (patch by <rtoy@google.com>): 12 <https://chromium.googlesource.com/chromium/src.git/+/f846f5a461d1fcdbe5152898576c125058079ed1> 13 14 * webaudio/convolver-channels-expected.txt: Added. 15 * webaudio/convolver-channels.html: Added. 16 * webaudio/resources/compatibility.js: Added. 17 1 18 2016-07-05 Johan K. Jensen <jj@johanjensen.dk> 2 19 -
trunk/Source/WebCore/ChangeLog
r202843 r202845 1 2016-07-05 David Kilzer <ddkilzer@apple.com> 2 3 Throw exceptions for invalid number of channels for ConvolverNode 4 <https://webkit.org/b/159238> 5 6 Reviewed by Brent Fulgham. 7 8 Fix based on a Blink change (patch by <rtoy@chromium.org>): 9 <https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5> 10 11 Also includes a related fix for ReverbConvolverStage (patch by <rtoy@chromium.org>): 12 <https://src.chromium.org/viewvc/blink?revision=157832&view=revision> 13 14 Test: webaudio/convolver-channels.html 15 16 * Modules/webaudio/ConvolverNode.cpp: 17 (WebCore::ConvolverNode::setBuffer): Throw an exception for 18 anything but 1, 2 or 4 channels. 19 * platform/audio/ReverbConvolverStage.cpp: 20 (WebCore::ReverbConvolverStage::ReverbConvolverStage): Don't read past the end of 21 the impulseResponse array. 22 1 23 2016-07-05 Johan K. Jensen <jj@johanjensen.dk> 2 24 -
trunk/Source/WebCore/Modules/webaudio/ConvolverNode.cpp
r202645 r202845 1 1 /* 2 2 * Copyright (C) 2010, Google Inc. All rights reserved. 3 * Copyright (C) 2016, Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 132 133 size_t bufferLength = buffer->length(); 133 134 134 // The current implementation supports up to four channel impulse responses, which are interpreted as true-stereo (see Reverb class). 135 bool isBufferGood = numberOfChannels > 0 && numberOfChannels <= 4 && bufferLength; 136 ASSERT(isBufferGood); 137 if (!isBufferGood) 135 // The current implementation supports only 1-, 2-, or 4-channel impulse responses, with the 136 // 4-channel response being interpreted as true-stereo (see Reverb class). 137 bool isChannelCountGood = (numberOfChannels == 1 || numberOfChannels == 2 || numberOfChannels == 4) && bufferLength; 138 139 if (!isChannelCountGood) { 140 ec = NOT_SUPPORTED_ERR; 138 141 return; 142 } 139 143 140 144 // Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not a memcpy(). -
trunk/Source/WebCore/platform/audio/ReverbConvolverStage.cpp
r165676 r202845 58 58 m_fftConvolver = std::make_unique<FFTConvolver>(fftSize); 59 59 } else { 60 ASSERT(!stageOffset); 61 ASSERT(stageLength <= fftSize / 2); 62 60 63 m_directKernel = std::make_unique<AudioFloatArray>(fftSize / 2); 61 m_directKernel->copyToRange(impulseResponse + stageOffset, 0, fftSize / 2);64 m_directKernel->copyToRange(impulseResponse, 0, stageLength); 62 65 m_directConvolver = std::make_unique<DirectConvolver>(renderSliceSize); 63 66 }
Note: See TracChangeset
for help on using the changeset viewer.