MLECO-2226 Fix for for loop in complex magnitude calculation
Change-Id: Id5c09851d4377cc52039a4988df93cfd84dab9c0
Signed-off-by: Éanna Ó Catháin <eanna.ocathain@arm.com>
diff --git a/source/application/main/PlatformMath.cc b/source/application/main/PlatformMath.cc
index 9d18151..0043635 100644
--- a/source/application/main/PlatformMath.cc
+++ b/source/application/main/PlatformMath.cc
@@ -182,7 +182,7 @@
#if ARM_DSP_AVAILABLE
arm_cmplx_mag_squared_f32(ptrSrc, ptrDst, srcLen/2);
#else /* ARM_DSP_AVAILABLE */
- for (uint32_t j = 0; j < srcLen; ++j) {
+ for (uint32_t j = 0; j < srcLen/2; ++j) {
const float real = *ptrSrc++;
const float im = *ptrSrc++;
*ptrDst++ = real*real + im*im;