From a9eead8a2ff37ef6c4c84d698cc3b3b74355b4bf Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 14 Sep 2026 22:49:30 -0400 Subject: [PATCH] dsp/fftfilt : Initialize fftfilt noise reduction members Initialize the noise reduction configuration members in all fftfilt constructors so they have defined values before noise reduction processing uses them. This prevents undefined behavior and ensures consistent default configuration regardless of which constructor is used. Found by cppcheck (uninitMemberVar). Signed-off-by: Robin Getz --- sdrbase/dsp/fftfilt.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sdrbase/dsp/fftfilt.cpp b/sdrbase/dsp/fftfilt.cpp index aa8123c76..39f238fe4 100644 --- a/sdrbase/dsp/fftfilt.cpp +++ b/sdrbase/dsp/fftfilt.cpp @@ -99,6 +99,10 @@ void fftfilt::init_filter() // f2 == 0 ==> high pass filter //------------------------------------------------------------------------------ fftfilt::fftfilt(int len) : + m_dnrScheme(FFTNoiseReduction::SchemeAverage), + m_dnrAboveAvgFactor(0.0f), + m_dnrSigmaFactor(0.0f), + m_dnrNbPeaks(0), m_noiseReduction(len) { flen = len; @@ -109,6 +113,10 @@ fftfilt::fftfilt(int len) : } fftfilt::fftfilt(float f1, float f2, int len) : + m_dnrScheme(FFTNoiseReduction::SchemeAverage), + m_dnrAboveAvgFactor(0.0f), + m_dnrSigmaFactor(0.0f), + m_dnrNbPeaks(0), m_noiseReduction(len) { flen = len; @@ -120,6 +128,10 @@ fftfilt::fftfilt(float f1, float f2, int len) : } fftfilt::fftfilt(float f2, int len) : + m_dnrScheme(FFTNoiseReduction::SchemeAverage), + m_dnrAboveAvgFactor(0.0f), + m_dnrSigmaFactor(0.0f), + m_dnrNbPeaks(0), m_noiseReduction(len) { flen = len;