Initialize m_radiotext_AB_flag in the RDSParser constructor to ensure the
radio text state is defined before the first Group 2 update.
Keep the flag out of clearUpdateFlags() because it is persistent parser state,
not a transient update flag. Resetting it when update flags are cleared could
incorrectly appear as an A/B transition and cause stale radio text handling.
Pointed out by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Zero-initialize the pilot PLL sample buffer used by BFMDemodSink.
This ensures all four PLL sample values have defined initial values
before they are consumed by the FM stereo processing path and removes
the uninitialized member warning reported by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the field and vertical sync detection sample counters and
the previous sample value in ATVDemodSink.
This gives the video synchronization state defined initial values when
the sink is constructed and removes the uninitialized member warnings
reported by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the channel pointer to nullptr and zero-initialize the
synchronous AM demodulation buffer in AMDemodSink.
This ensures both members have defined values when the sink is
constructed and removes the uninitialized member warnings reported by
cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the m_bytes buffer to zero so all elements have defined
values when an AISDemodSink is constructed.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_matchColumn and m_autoTarget in the NotificationSettings
constructor rather than assigning m_matchColumn in the constructor body.
This ensures both members are initialized before the constructor body
executes and removes the uninitialized m_autoTarget member.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Value-initialize the Interogator airspace member so it has a defined
state when an Interogator is constructed.
Found by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the CPR latitude and longitude state when an Aircraft is
created so the position data has defined values before the first CPR
calculation.
Found by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_channel to nullptr in the ChannelPowerSink constructor to
ensure the pointer has a defined value before a channel is assigned.
Found by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_scopeGUI to nullptr in the settings constructor. The pointer
was not initialized and is only assigned through setScopeGUI().
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_useReverseAPI to false when resetting Interferometer settings
to their defaults. The member was not initialized by the constructor or
resetToDefaults(), allowing its value to be read before being set.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_useReverseAPI to false when resetting DOA2 settings to their
defaults. The member was not initialized by the constructor or
resetToDefaults(), allowing its value to be read before being set.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_streamIndex to zero in the stream source constructor.
BeamSteeringCWModBaseband subsequently assigns each source its actual
stream index, but initializing the member ensures getStreamIndex() does
not expose an indeterminate value during construction.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Fix Coverity CID 652347 reporting an uninitialized scalar variable.
Replace XOR self-assignment with explicit zero initialization to
avoid reading uninitialized SIMD elements.
Modern compilers already optimize zero assignments to efficient
zeroing instructions where appropriate.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Coverity reported an uninitialized value use in AISModSource::modulateSample().
The Gaussian filter output variable was only assigned during transmission,
but was used afterwards when the modulator was idle or waiting.
Initialize the variable to zero to match the idle sample behavior.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Coverity reported an uninitialized m_rx2txGPIOEnable value when it was
used by SimplePTTGUI before settings were loaded. Initialize the setting
in resetToDefaults() to provide a defined default value.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Coverity reported an uninitialized scalar use of varPhase when the
reference and variable Goertzel filters completed at different times.
Store the last valid variable phase and magnitude values to ensure the
radial calculation always uses initialized data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Coverity reported that an invalid sample size could leave the
conversion buffer uninitialized before it was passed to calcPower()
and the sample FIFO.
Return early when the sample conversion format is unsupported to
prevent processing invalid data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The HDLC encoder accumulated bits into m_bits using the |= operator
without first initializing the first byte. This resulted in an
uninitialized read of m_bits[0] when encoding the first bit of a
packet.
Initialize each output byte when writing its first bit, ensuring the
buffer contains a defined value before bits are OR'ed into it. This
also makes addBit() self-contained, eliminating the need for callers to
pre-initialize the current output byte.
Reported by Coverity.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Cppcheck reported several AISModSource members that were not initialized
by the constructor. Initialize the remaining scalar members in the
constructor initializer list to establish a well-defined initial state
and avoid undefined behavior if they are accessed before being assigned.
Reported by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Validate the tuner type index before accessing the tuner name table.
The previous check allowed an index equal to names.size(), which could
result in an out-of-range QStringList access.
Use a local integer value for the enum conversion and ensure only valid
indices are used when looking up tuner names.
pointed out by cppcheck: Access out of bounds
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace variable length arrays in SumProductAlgorithm::finalp() with a
std::vector buffers.
This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace variable length arrays in LambdaMinAlgorithm::finalp() with
std::vector storage.
Update nth_element() usage to operate on vector iterators while removing
the non-standard VLA usage.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace variable length arrays in LogDomainSPA::finalp() with
std::vector buffers.
This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace the variable length temporary array in the int8_t FACTOR
specialization of MinSumCAlgorithm::finalp() with a std::vector buffer.
This removes reliance on compiler VLA extensions and uses standard C++
storage for the temporary reduction buffer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace the variable length temporary array in the float FACTOR
specialization of MinSumCAlgorithm::finalp() with a std::vector buffer.
This removes reliance on compiler VLA extensions and uses standard C++
storage for the temporary reduction buffer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace the variable length temporary array in MinSumCAlgorithm::finalp()
with a std::vector buffer.
This removes reliance on compiler VLA extensions and uses standard C++
storage for the temporary reduction buffer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace variable length arrays in the int8_t FACTOR specialization of
OffsetMinSumAlgorithm::finalp() with a single std::vector scratch buffer.
This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace variable length arrays in OffsetMinSumAlgorithm::finalp() with a
std::vector buffers.
This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace variable length arrays in the int8_t specialization of
MinSumAlgorithm::finalp() with a single std::vector scratch buffer.
This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace variable length arrays in the float specialization of
MinSumAlgorithm::finalp() with std::vector storage.
This removes reliance on compiler VLA extensions and keeps the
temporary buffers managed by standard C++ containers.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The gain change handler allowed an index equal to m_gains.size(),
which is outside the valid vector range. Reject invalid indices before
accessing the gain table to avoid undefined behavior.
found with cppcheck: Access out of bounds
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The channel count comparison in getChannelsByDevice() accidentally used
the first plan's channel count for both operands. This caused the comparator
to always treat the channel counts as equal and sort only by bandwidth.
Use the second plan's channel count when comparing RRTurnPlans so plans are
ordered correctly by number of channels before applying the bandwidth
tie-breaker.
Signed-off-by: Robin Getz <rgetz503@gmail.com>