Bug 1270055 - Unaligned buffer used in DynamicsCompressor; r=padenot

MozReview-Commit-ID: 4xVYjCGblTV

--HG--
extra : rebase_source : 28400783fa926ebc2832529e32688033e3420e3c
This commit is contained in:
Dan Minor 2016-05-04 06:49:07 -04:00
Родитель d9348654ed
Коммит 68f5130961
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -27,6 +27,7 @@
*/ */
#include "DynamicsCompressor.h" #include "DynamicsCompressor.h"
#include "AlignmentUtils.h"
#include "AudioBlock.h" #include "AudioBlock.h"
#include <cmath> #include <cmath>
@ -198,7 +199,9 @@ void DynamicsCompressor::process(const AudioBlock* sourceChunk, AudioBlock* dest
setEmphasisParameters(filterStageGain, anchor, filterStageRatio); setEmphasisParameters(filterStageGain, anchor, filterStageRatio);
} }
float sourceWithVolume[WEBAUDIO_BLOCK_SIZE]; float sourceWithVolume[WEBAUDIO_BLOCK_SIZE + 4];
float* alignedSourceWithVolume = ALIGNED16(sourceWithVolume);
ASSERT_ALIGNED16(alignedSourceWithVolume);
// Apply pre-emphasis filter. // Apply pre-emphasis filter.
// Note that the final three stages are computed in-place in the destination buffer. // Note that the final three stages are computed in-place in the destination buffer.
@ -210,8 +213,8 @@ void DynamicsCompressor::process(const AudioBlock* sourceChunk, AudioBlock* dest
} else { } else {
AudioBlockCopyChannelWithScale(m_sourceChannels[i], AudioBlockCopyChannelWithScale(m_sourceChannels[i],
sourceChunk->mVolume, sourceChunk->mVolume,
sourceWithVolume); alignedSourceWithVolume);
sourceData = sourceWithVolume; sourceData = alignedSourceWithVolume;
} }
float* destinationData = m_destinationChannels[i]; float* destinationData = m_destinationChannels[i];