Initialize m_deviceIndex to prevent use of an indeterminate
device index before configuration is applied.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the FIFO size and read, served, and write indices in
the default constructor to prevent use of indeterminate state.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_buf to nullptr before allocating the sample buffer
and initialize m_log2Interp to prevent use of indeterminate state.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Value-initialize both sample buffers and initialize m_log2Decim
to prevent use of indeterminate member values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Value-initialize AzAlt and sun right-ascension/declination
structures in update() to prevent use of indeterminate
coordinate values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize prevAz to avoid using an indeterminate azimuth value
when checking satellite passes through zero degrees.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_scopeGUI to nullptr in the settings constructor to
prevent use of an indeterminate pointer value.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize estimated pitch, speed, signal threshold, and cost
function in MsgReportText to prevent indeterminate metric values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Zero-initialize RNNoise, NVIDIA, and VST3 input/output buffers and
initialize RMS and output peak levels to prevent use of
indeterminate member values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Delete the message when getMessageQueueToGUI() returns null.
The message is allocated in updateDeviceSetLists(), but was only
transferred to the GUI message queue when the queue existed.
Without a queue, the message was never released, causing a
resource leak reported by Coverity.
Keep the existing behavior of pushing the message to the GUI
queue when available, and explicitly delete it otherwise.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize sample rates, frequency offsets, center frequency, and
device UID to prevent use of indeterminate member values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize spectrum sink, GUI message queue, timer, and center
frequency members to prevent use of indeterminate state.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the FIFO size and read, served, and write indices in
the default constructor to prevent use of indeterminate state.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Allocate QNetworkAccessManager in the constructor initializer list
so applySettings() cannot access it before initialization.
Identified by Coverity.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the channel pointer to nullptr and zero the bit buffer
to prevent use of indeterminate member values during demodulation.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Value-initialize the DVB and Freesat section containers in the EPG
constructor to ensure section storage starts in a defined state.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Free the optional bitcount and errcount pipewriters in the
s2_fecdec_helper destructor. Both writers are allocated by
opt_writer() in the constructor but were never released, causing
Coverity resource leak findings (CIDs 652669 and 652407).
Delete the writers after killall() has stopped and cleaned up
the helper processes, ensuring their resources are released
without affecting shutdown processing. Deleting null pointers
is safe when the optional output pipes are not configured.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Prevent copying or assigning APTDemodSink objects, avoiding
accidental duplication of internal processing state and resources.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Set m_northToSouth to false in resetToDefaults() so resetting
APT demodulator settings also initializes the scan direction.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Value-initialize the MsgLine buffer so its contents are defined
before the line data is populated.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Move AOS and LOS debug logging inside the satellite name null
checks to prevent dereferencing a null pointer when the API
action does not provide a satellite name.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize detector, synchronization, signal statistics, and framer
state in the receiver constructor to prevent use of indeterminate
member values.
Identified by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Value-initialize the local DTVVideoPlayer::Info object in
displayPlayerInfo() so its members are initialized when no
player instance is available.
Coverity CID 657528 identified a possible uninitialized read
of m_audioFrames.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Mask the symbol index to one bit when indexing m_chipsBPSK,
which contains only two symbol entries.
Coverity identified a potential out-of-bounds read when
getSymbol() returns a value greater than 1. Mask the index
to ensure the lookup stays within the array bounds and
match the existing BPSK indexing in IEEE_802_15_4_PHY.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
After adding the SFO drift (4.25 * sfo_hat) to the fractional STO, the
value was wrapped back into [-0.5, 0.5] but the removed whole chip was
discarded, misaligning subsequent symbols by m_osFactor samples. This
mostly bites at high SF with clock drift, where the drift term can
reach ~0.3+ chips.
- Fold the wrapped chip(s) into the returned FIFO advance (-chips * os).
- Wrap via loRaRound() (half away from zero), so |sto_frac| >= 0.5 now
wraps; previously exactly 0.5 did not. Equivalent timing either way.
- Reset non-finite STO before rounding (float->int cast of NaN/inf is UB).
- Log when the FIFO advance is clamped to 1.
Other applications (e.g. SoapyPlutoSDR, used by gqrx) leave the RX LO
powered down when they close, so SDRangel only received the AD9361's
own noise. In FDD mode the Tx LO also stays up while no stream runs,
radiating LO leakage when the Tx device is merely opened.
Set the LO powerdown attribute explicitly: power the LO up when a
stream starts, down when it stops or fails, and power the Tx LO down
when the Tx device is opened. Applies to the input, output and MIMO
plugins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RTTY, NAVTEX and ILS demods read logFilename/logEnabled from
getAdsbDemodSettings(), which is null for those channels, so a PATCH of
either key crashes SDRangel. Also fix M17 Mod reverseAPIChannelIndex
(read from NFM Mod settings), Audio CAT SISO settings get and XTRX MIMO
reverse API settings and report (Input instead of MIMO types), and
BladeRF2 Output title (BladeRF1 settings).
libiio 1.x installs its header as include/iio/iio.h instead of
include/iio.h. Look for the 1.x layout first and fall back to the 0.x
one, and set LIBIIO_V1 so plutosdrdevice can select the API at compile
time. The bundled external build (v0.26) keeps the 0.x path.
The input and output plugin headers only need the iio_buffer type, so
forward-declare it instead of including iio.h.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve GCC -Wreorder by moving m_spectrumBinHz before
m_autoUnlockedSamples in the constructor initializer list to
match declaration order in the header. C++ initializes members
in declaration order regardless of initializer list order, so
keeping the list aligned avoids misleading initialization
sequences and helps prevent future initialization bugs.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Resolve GCC -Wtype-limits warnings by removing upper-bound
comparisons that are always true or false for uint16_t.
The port's type already enforces the maximum value of 65535;
validation of wider input values remains in place before casting.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Resolve the compiler warning for the unused frequencyHz parameter
in processAcquisitionSample(). Use Q_UNUSED to explicitly document
that the parameter is intentionally unused without changing behavior.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Resolve GCC -Wmissing-field-initializers by explicitly initializing
the onEdit callback to an empty std::function. This ensures the
callback starts in a defined empty state and avoids relying on
implicit aggregate initialization behavior.
Signed-off-by: Robin Getz <rgetz503@gmail.com>