From 26162c49a1c3abd1e75af54cab6f3859809f400d Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 12 Sep 2015 00:40:36 +0200 Subject: [PATCH] Corrected some decimator loops --- include-gpl/dsp/decimators.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include-gpl/dsp/decimators.h b/include-gpl/dsp/decimators.h index 2579dcb26..f2e3362c2 100644 --- a/include-gpl/dsp/decimators.h +++ b/include-gpl/dsp/decimators.h @@ -131,7 +131,7 @@ void Decimators::decimate1(SampleVector::iterator* it, co { qint32 xreal, yimag; - for (int pos = 0; pos < len; pos += 2) + for (int pos = 0; pos < len - 1; pos += 2) { xreal = buf[pos+0]; yimag = buf[pos+1]; @@ -209,7 +209,7 @@ void Decimators::decimate2_cen(SampleVector::iterator* it { int pos = 0; - while (pos < len - 3) + while (pos < len - 1) { qint32 x0 = buf[pos+0] << decimation_shifts::pre2; qint32 y0 = buf[pos+1] << decimation_shifts::pre2; @@ -229,7 +229,7 @@ void Decimators::decimate4_cen(SampleVector::iterator* it { int pos = 0; - while (pos < len) + while (pos < len - 1) { qint32 x0 = buf[pos+0] << decimation_shifts::pre4; qint32 y0 = buf[pos+1] << decimation_shifts::pre4; @@ -255,7 +255,7 @@ void Decimators::decimate8_cen(SampleVector::iterator* it { int pos = 0; - while (pos < len) + while (pos < len - 1) { qint32 x0 = buf[pos+0] << decimation_shifts::pre8; qint32 y0 = buf[pos+1] << decimation_shifts::pre8; @@ -287,7 +287,7 @@ void Decimators::decimate16_cen(SampleVector::iterator* i { int pos = 0; - while (pos < len) + while (pos < len - 1) { qint32 x0 = buf[pos+0] << decimation_shifts::pre16; qint32 y0 = buf[pos+1] << decimation_shifts::pre16; @@ -325,7 +325,7 @@ void Decimators::decimate32_cen(SampleVector::iterator* i { int pos = 0; - while (pos < len) + while (pos < len - 1) { qint32 x0 = buf[pos+0] << decimation_shifts::pre32; qint32 y0 = buf[pos+1] << decimation_shifts::pre32; @@ -370,7 +370,7 @@ void Decimators::decimate64_cen(SampleVector::iterator* i { int pos = 0; - while (pos < len) + while (pos < len - 1) { qint32 x0 = buf[pos+0] << decimation_shifts::pre64; qint32 y0 = buf[pos+1] << decimation_shifts::pre64;