Document that callers must hold m_mutex when calling
LDPCPool::cancel(). This clarifies the locking contract and
addresses the Coverity finding as a false positive.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Fix Coverity CIDs 657466, 657471, and 657508 by protecting
reads of m_inputRate with m_ofdmMutex. Copy the rate while
holding the mutex and use the local copy outside the
critical section.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Fix Coverity CID 657550 by avoiding the shift when m_nd is
zero. The previous expression could shift by -1, causing
undefined behavior.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Fix Coverity CID 657456 by locking m_mutex before accessing
slot.m_epoch and m_resetEpoch in Receiver::deframe(). This
ensures the epoch check is synchronized with writes to
slot.m_epoch.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Zero-initialize m_packet in the outer decoder constructor to
prevent use of indeterminate packet data.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize ring buffer, smoothing, phase tracking, and TPS state
in the OFDM demodulator constructor to prevent use of
indeterminate member values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Zero-initialize m_tpsBits in the modulator constructor so TPS
processing does not read indeterminate bit-buffer contents.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize grid spacing, offset, and amplitude in the OFDMDemod
constructor to prevent use of indeterminate member values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Value-initialize m_postBlock in the L1Codec constructor to ensure
the post-LDPC block state starts initialized.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Reject invalid constellation values before configuring decoder
state or calculating bit-interleaver sizes and indices.
This prevents invalid bits-per-cell values from causing
invalid vector sizes and out-of-bounds accesses.
Coverity CIDs 657500 and 657487.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Reject non-positive BCH information lengths before scrambling
or decoding the frame, and log a warning with the invalid value.
Coverity CID 657505 identified a potential negative length
passed to scrambleBytes().
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Reject invalid constellation values before calling bitsPerCell()
and using the result in cell and bit index calculations.
Emit a warning containing the invalid enum value and return
without processing the block.
Coverity CID 657524 identified a potential integer overflow
in the bit-map index calculation.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Reject invalid constellation values before calculating cell and bit
indices, preventing invalid values from reaching the demux table
lookup and map indexing.
Clear the output map and emit a warning when the constellation is
invalid.
Coverity CID 657539 identified a potential out-of-bounds access
caused by an invalid constellation value.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Remove the unused eta variable in Receiver::decodeFrame().
The value returned by bitsPerCell() was never used, so its
calculation is unnecessary and removing it eliminates the
unused-variable compiler warning without changing behavior.
Signed-off-by: Robin Getz <rgetz503@gmail.com>