From b34caee95ca9ab67c0e51039975a82f81eacdaf0 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Tue, 27 Oct 2026 20:11:54 -0400 Subject: [PATCH] modemdrm: Guard against missing spectrum parameters Fix Coverity CID 657650 by checking the result of Parameters::forSpectrum() before dereferencing it in estimateFrameWiener(). Return false if no spectrum parameters are available. Signed-off-by: Robin Getz --- modemdrm/drmchannelestimator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modemdrm/drmchannelestimator.cpp b/modemdrm/drmchannelestimator.cpp index 50d2af43c..dbbbc4381 100644 --- a/modemdrm/drmchannelestimator.cpp +++ b/modemdrm/drmchannelestimator.cpp @@ -1578,6 +1578,9 @@ bool ChannelEstimationContext::estimateFrameWiener( const auto& fftFrames = *m_frames; const ModeParameters& parameters = Parameters::forMode(mode); const SpectrumParameters* spectrum = Parameters::forSpectrum(mode, occupancy); + if (!spectrum) { + return false; + } const int carrierCount = spectrum->maximumCarrier - spectrum->minimumCarrier + 1; const float temporalCorrelation = m_temporalCorrelation; const TemporalWeights weights = temporalWeights(temporalCorrelation);