bug 1389638 use correct input elements for summing squares of trailing unaligned input r?dminor draft
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 11 Aug 2017 23:42:46 +1200
changeset 645178 7091192fd5ee850f172178ec5f577787a363c5d8
parent 645177 b550b7963ac72d9f7417d544cf5cb78d2c7d6836
child 645179 23337d67c5b5f765f956700a47de414df0e53b2a
push id73684
push userktomlinson@mozilla.com
push dateFri, 11 Aug 2017 22:29:12 +0000
reviewersdminor
bugs1389638
milestone57.0a1
bug 1389638 use correct input elements for summing squares of trailing unaligned input r?dminor
dom/media/webaudio/AudioNodeEngine.cpp
--- a/dom/media/webaudio/AudioNodeEngine.cpp
+++ b/dom/media/webaudio/AudioNodeEngine.cpp
@@ -365,17 +365,17 @@ AudioBufferSumOfSquares(const float* aIn
       --aLength;
     }
 
     uint32_t vLength = (aLength >> 4) << 4;
     sum += AudioBufferSumOfSquares_SSE(alignedInput, vLength);
 
     // adjust aInput and aLength to use scalar operations for any
     // remaining values
-    aInput = alignedInput + 1;
+    aInput = alignedInput + vLength;
     aLength -= vLength;
   }
 #endif
 
   while (aLength--) {
     sum += *aInput * *aInput;
     ++aInput;
   }