From 68f5130961f09ed515bdfba86308205b0faea338 Mon Sep 17 00:00:00 2001 From: Dan Minor Date: Wed, 4 May 2016 06:49:07 -0400 Subject: [PATCH] Bug 1270055 - Unaligned buffer used in DynamicsCompressor; r=padenot MozReview-Commit-ID: 4xVYjCGblTV --HG-- extra : rebase_source : 28400783fa926ebc2832529e32688033e3420e3c --- dom/media/webaudio/blink/DynamicsCompressor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dom/media/webaudio/blink/DynamicsCompressor.cpp b/dom/media/webaudio/blink/DynamicsCompressor.cpp index 57d511294ff3..8f18913c00b4 100644 --- a/dom/media/webaudio/blink/DynamicsCompressor.cpp +++ b/dom/media/webaudio/blink/DynamicsCompressor.cpp @@ -27,6 +27,7 @@ */ #include "DynamicsCompressor.h" +#include "AlignmentUtils.h" #include "AudioBlock.h" #include @@ -198,7 +199,9 @@ void DynamicsCompressor::process(const AudioBlock* sourceChunk, AudioBlock* dest 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. // 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 { AudioBlockCopyChannelWithScale(m_sourceChannels[i], sourceChunk->mVolume, - sourceWithVolume); - sourceData = sourceWithVolume; + alignedSourceWithVolume); + sourceData = alignedSourceWithVolume; } float* destinationData = m_destinationChannels[i];