1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-29 05:24:18 -04:00
Commit Graph

11225 Commits

Author SHA1 Message Date
Edouard Griffiths a7969d1c8a Merge pull request #2852 from rgetz/rgetz-reduce-vlas-dvbs2
continue to reduce (eliminate) VLA usage from leansdr
2026-07-27 12:42:33 +02:00
Edouard Griffiths 6efccde2e3 Merge pull request #2851 from rgetz/rgetz-fix-incorrect-iterator
ADSB Demod: Fix incorrect iterator range when restoring column sizes
2026-07-27 11:56:44 +02:00
Edouard Griffiths 2dfcf88259 Merge pull request #2850 from rgetz/rgetz-fix-missing-copy-glscopesettings
GLScope: Fix missing freerun setting copy in assignment operator
2026-07-27 08:42:35 +02:00
Edouard Griffiths d23b91a6eb Merge pull request #2847 from srcejon/fix_2839
Fix Astronomy::azAltToXY85 when azimuth or elevation is 0.
2026-07-27 08:41:53 +02:00
Edouard Griffiths 7675cb3e4c Merge pull request #2846 from rgetz/rgetz-fix-uninitialized-variable-ft8
FT8/FT4: Remove uninitialized value warnings
2026-07-26 21:54:10 +02:00
Edouard Griffiths 7ade66e467 Merge pull request #2845 from rgetz/rgetz-fix-boolean-bitwise
Fix UDP port validation boolean operations
2026-07-26 21:40:09 +02:00
Robin Getz f57e6d3568 DATV: Replace DVB-S2 pilot VLA buffers with std::vector
Replace variable-length arrays used for DVB-S2 pilot symbol matching with
std::vector allocations.

Use vector::data() when passing buffers to the existing pointer-based
match_ph_amp() function. This removes non-standard VLA usage and improves
C++ portability without changing behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:54:12 -04:00
Robin Getz def0a877db DATV: Replace DVB-S2 pilot VLA buffers with std::vector
Replace variable-length arrays used for DVB-S2 pilot symbol matching with
std::vector allocations.

Use vector::data() when passing buffers to the existing pointer-based
match_ph_amp() function. This removes additional non-standard VLA usage and
improves C++ portability without changing behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:50:25 -04:00
Robin Getz 1e72e94bb5 DATV: Replace DVB-S2 SOF VLA buffer with std::vector
Replace the variable-length array used for SOF symbol buffering in the
DVB-S2 frame receiver with a std::vector allocation.

Use vector::data() when passing the buffer to the existing pointer-based
conjugate product function. This removes another non-standard VLA usage and
improves C++ portability without changing behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:45:38 -04:00
Robin Getz 16ab693062 DATV: Replace DVB-S2 VLA buffers with std::vector
Replace non-standard variable-length arrays used for PLHEADER symbol
processing with std::vector allocations. Update buffer copies and pointer
interfaces accordingly while preserving existing behavior.

This removes VLA compiler/static analysis warnings and improves C++
portability.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:38:53 -04:00
Robin Getz 60dbed7fc3 dvbs2.h : remove tabs, replace with spaces
to match style

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:33:38 -04:00
Edouard Griffiths 38a665f16f Merge pull request #2849 from srcejon/fix_2848
Attempt to fix debian build
2026-07-26 20:22:48 +02:00
Edouard Griffiths 31197025b4 Merge pull request #2844 from rgetz/rgetz-fix-testmi
testmi: Fix missing m_title copy in TestMISettings
2026-07-26 20:21:35 +02:00
Robin Getz 66d28efcc1 ADSB Demod: Fix incorrect iterator range when restoring column sizes
cppcheck reported that the std::copy() call used iterators from different
containers when restoring ADSB demod table column sizes.

The copy operation used settings.m_columnSizes as the source start iterator
but settings.m_columnIndexes as the source end iterator. This was likely a
copy/paste error and resulted in an invalid iterator range.

Use settings.m_columnSizes for both source iterators so column size settings
are restored correctly.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 13:44:02 -04:00
Robin Getz 3657fc1532 GLScope: Fix missing freerun setting copy in assignment operator
cppcheck reported that GLScopeSettings::operator=() did not assign the
m_freerun member variable.

m_freerun is part of the GLScope configuration state: it is initialized
in resetToDefaults(), and is persisted through serialize()/deserialize().
However, when a GLScopeSettings object was copied using the assignment
operator, the freerun state was not transferred from the source object.

This could result in two GLScopeSettings instances having different
freerun values after assignment, with the destination object retaining
its previous value instead of matching the source object.

Add the missing m_freerun assignment to ensure operator=() performs a
complete copy of the settings state and matches the existing
serialization behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 13:28:46 -04:00
Edouard Griffiths b1e685b71c Merge pull request #2843 from rgetz/rgetz-fix-index-used-before-check
wdsp: Prevent potential out-of-bounds array access
2026-07-26 15:40:15 +02:00
Jon Beniston ab8c127a4a Fix sed script on Linux. Also fix new flatbuffer build on linux 2026-07-26 13:47:30 +01:00
Edouard Griffiths e01381996d Merge pull request #2842 from rgetz/rgetz-leansdr-fail-fatal
DATV: Convert leansdr fail and fatal errors into C++ exceptions
2026-07-26 13:30:01 +02:00
Edouard Griffiths 148ca3870e Merge pull request #2841 from rgetz/rgetz-reduce-vla-ldpctool-algorithms
step2 : reduce vlas
2026-07-26 09:59:50 +02:00
Edouard Griffiths 9306940671 Merge pull request #2840 from rgetz/rgetz-reduce-vla-leansdr
step 1 : reduce vla usage
2026-07-26 06:47:44 +02:00
Jon Beniston 82fe3fbfe9 Fix Astronomy::azAltToXY85 when azimuth or elevation is 0. #2839 2026-07-26 02:09:56 +01:00
Robin Getz 9b3e3e1865 FT8/FT4: Remove uninitialized value warnings
Fix cppcheck warnings about uninitialized mx variables in coarse
strength and soft symbol conversion calculations.

Replace the mxi sentinel logic with an explicit -infinity initial
maximum value, allowing the maximum search to operate directly on the
value being tracked. This removes reliance on short-circuit evaluation
for initialization and simplifies the code.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 20:27:17 -04:00
Robin Getz 0ee3237db5 Fix UDP port validation boolean operations
cppcheck reported boolean expressions being used in bitwise operations
when validating UDP ports. Replace accidental '&' operators with logical
'&&' operators.

Also replace hard-coded port range limits with UINT16_MAX to make the
valid UDP port range explicit and keep UDP source/sink validation
consistent.

No functional change.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 20:11:59 -04:00
Robin Getz 5c359aa0a4 testmi: Fix missing m_title copy in TestMISettings
cppcheck reported that the TestMISettings copy constructor did not
initialize member variable m_title:
  Member variable 'TestMISettings::m_title' is not assigned in the copy
  constructor. Should it be copied?

m_title is part of the serialized settings state, so ensure copied
TestMISettings instances preserve the configured title value.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 19:51:39 -04:00
Robin Getz 665f5e77ad wdsp: Prevent potential out-of-bounds array access
Fix cppcheck warnings where array elements were accessed before validating
their indices. Reorder conditional expressions to ensure bounds checks are
performed before array accesses, taking advantage of C++ short-circuit
evaluation.

In EMNR::NP::interpM(), check the index limit before accessing xvals[idx].
In SNBA::scanFrame(), verify i is within the merit array bounds before
evaluating merit[i].

These changes improve defensive programming practices and prevent potential
undefined behavior if an index exceeds the valid range. No functional changes.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 19:30:38 -04:00
Robin Getz e86e95feab DATV: Convert leansdr fail and fatal errors into C++ exceptions
The original leansdr code uses fatal() and fail() for unrecoverable errors by
terminating execution. When integrated into SDRangel, these error paths did
not provide a mechanism for the plugin to handle failures locally, allowing
initialization failures to escape the normal plugin lifecycle.

Convert leansdr fatal() and fail() handling into C++ exceptions so DATV can
detect framework initialization failures, report them, and cleanly return
control to SDRangel instead of allowing the error to terminate the application.
This behavior is desirable because a DATV framework configuration failure
should not bring down the entire application.

Catch initialization exceptions in DATVDemodSink::feed(), report the failure,
clean up the partially initialized framework, and return to the caller.

Add noreturn annotations to the leansdr error functions and include the
leansdr source in exception messages to make failures easier to diagnose.

This does not redesign leansdr error handling or provide recovery from
runtime DSP failures. It only adds an exception boundary between the
leansdr library code and the SDRangel plugin lifecycle.

noticed via cppcheck indicating many Array indexes could go out of bounds
due to fail and fatal returning.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 18:50:40 -04:00
Robin Getz 1772ff5ecb demoddatv: Replace MinSumAlgorithm int8 VLA with std::vector
Replace the runtime-sized temporary array in the int8_t specialization of
MinSumAlgorithm::finalp() with std::vector.

The array size is determined by the runtime value of cnt, requiring a
compiler VLA extension. Using std::vector preserves the existing behavior
while removing the dependency on non-standard language extensions.

This eliminates remaining -Wvla warnings (for me) reported from
ldpctool/algorithms.h

Part of #2830

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 16:45:07 -04:00
Robin Getz ef54a1ef6c demoddatv: Replace MinSumCAlgorithm VLA with std::vector
Replace the runtime-sized temporary array in
MinSumCAlgorithm::finalp() with std::vector.

The temporary array size depends on the runtime value of cnt, requiring a
compiler VLA extension. Using std::vector preserves the existing behavior
while removing the dependency on non-standard language extensions.

This eliminates ~6 of remaining -Wvla warnings (for me) reported
from ldpctool/algorithms.h

Part of #2830

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 16:44:58 -04:00
Robin Getz 144d40475b demoddatv: Replace OffsetMinSumAlgorithm int8 VLA with std::vector
Replace the runtime-sized temporary array in the int8_t specialization of
OffsetMinSumAlgorithm::finalp() with std::vector.

The array size is determined by the runtime value of cnt, requiring a
compiler VLA extension. Using std::vector preserves the existing behavior
while removing the dependency on non-standard language extensions.

This eliminates ~12 of remaining -Wvla warnings (for me) reported
from ldpctool/algorithms.h

Part of #2830

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 16:39:31 -04:00
Robin Getz a10746a22a demoddatv: Replace OffsetMinSumAlgorithm VLAs with std::vector
Replace the runtime-sized temporary arrays in
OffsetMinSumAlgorithm::finalp() with std::vector.

The array sizes depend on the runtime value of cnt, requiring compiler
support for variable length arrays. Using std::vector removes this
non-standard extension while preserving the existing algorithm and memory
layout.

This eliminates ~24 of remaining -Wvla warnings (for me) reported
from ldpctool/algorithms.h.

Part of #2830

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 16:39:31 -04:00
Robin Getz 463daf7eed demoddatv: Replace MinSumAlgorithm VLAs with std::vector
Replace the runtime-sized temporary arrays used by
MinSumAlgorithm<SIMD<...>>::finalp() with std::vector.

The array sizes are determined at runtime from the number of links,
making them variable-length arrays that rely on compiler extensions.
Using std::vector removes the dependency on VLA support while
preserving the existing algorithm and behavior.

This eliminates ~24 of remaining -Wvla warnings (for me) reported
from ldpctool/algorithms.h.

Part of #2830

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 16:39:23 -04:00
Robin Getz fef5c27425 demoddatv: Replace spectrum VLA with std::vector
Replace the runtime-sized stack array in the spectrum processing path
with std::vector to avoid compiler VLA extensions.

Although the spectrum template is not instantiated as part of the
current SDRangel build, GCC still emits -Wvla warnings while parsing
the template definition. This change removes those warnings and keeps
the template valid for future use.

Use std::copy() and vector::data() when accessing the underlying
storage.

Part of #2830

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 15:44:41 -04:00
Robin Getz bd0ad31f77 demoddatv: Fix spectrum compilation against current cfft_engine API
The spectrum template was not being instantiated by the current build,
so stale accesses to cfft_engine::n went unnoticed.

Replace direct accesses to the private cfft_engine member with the
public size() accessor. This restores spectrum compilation and allows
the upcoming VLA cleanup to be built and tested.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 15:28:57 -04:00
Edouard Griffiths b5f216f049 Merge pull request #2836 from rgetz/rgetz-fix-pluto-close-device
PlutoSDR: keep device open state consistent after close
2026-07-25 13:27:12 +02:00
Edouard Griffiths 7af5f037ed Merge pull request #2832 from srcejon/fix_2831
Fix -DWITH_STACK_PROTECTOR=PFF typo.
2026-07-25 12:42:09 +02:00
Edouard Griffiths 6cbb612db0 Merge pull request #2829 from rgetz/rgetz-fix-wdsp-sphp
WDSP: Fix invalid iterator ranges in SPHP flush
2026-07-25 12:04:20 +02:00
Edouard Griffiths 0a9b2114bc Merge pull request #2828 from rgetz/rgetz-fix-radioastronomygui.cpp
Improve RadioAstronomyGUI robustnes
2026-07-25 11:42:51 +02:00
Robin Getz e46f204796 PlutoSDR: keep device open state consistent after close
Clear the m_open flag when closing PlutoSDR input and output
devices. Previously closeDevice() released m_deviceParams but left
m_open set, leaving the object in an inconsistent state where code
could treat a closed device as still valid.

This was exposed when reloading a running PlutoSDR device, where GUI
updates could access the partially torn-down device state.

Hopefully fixes #2833 (I don't have a windows machine to test).

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-23 21:31:43 -04:00
Jon Beniston 2d3f39bdf8 Fix typo. #2831 2026-07-23 10:37:02 +01:00
Robin Getz 95548a92aa WDSP: Fix invalid iterator ranges in SPHP flush
Correct std::fill() calls in SPHP::flush() that used x0.end() as the
end iterator when clearing x1, y0, and y1.

The incorrect ranges were likely introduced by a copy/paste error and
resulted in iterator pairs from different containers being used
together, causing undefined behavior.

Use each buffer's own end iterator when clearing its contents.

Detected by cppcheck's mismatchingContainer check.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:44:45 -04:00
Robin Getz 68aea9c16f RadioAstronomy: Apply channel settings only after dialog acceptance
Only apply channel settings after BasicChannelSettingsDialog returns an
accepted result. Previously, the return value from dialog.exec() was ignored
and settings were copied from the dialog regardless of whether the dialog was
accepted or rejected.

This could cause changes made in the channel settings dialog to be applied
even when the user discarded them. Check the dialog result before updating
the channel title, color, Reverse API configuration, and stream index to keep
the GUI state synchronized with the user's action.

This also fixes the Coverity CHECKED_RETURN warning for the unchecked
QDialog::exec() return value.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:37:16 -04:00
Robin Getz 10d9d503c7 RadioAstronomy: Initialize FFT measurement fields
Initialize previously unset FFTMeasurement members with defined default
values so newly constructed measurement objects start in a known state.

Although these fields are populated during normal measurement processing,
constructors should establish a complete and deterministic object state
rather than leaving scalar members with indeterminate values. This also
makes the class safer if the initialization sequence changes in the future.

This fixes a Coverity UNINIT_CTOR warning caused by uninitialized scalar
members in the constructor.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:20:30 -04:00
Robin Getz a637a20447 RadioAstronomy: Initialize sensor measurement range values
Initialize m_min and m_max in the SensorMeasurements constructor to ensure
the object has a valid state immediately after construction, before init()
is called.

Although init() sets these values before normal use, constructors should
fully initialize all class members to avoid leaving objects with undefined
state and to make the class safe to use regardless of initialization order.

This fixes a Coverity UNINIT_CTOR warning caused by uninitialized scalar
members in the constructor.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:05:01 -04:00
Robin Getz b44ff3ee00 RadioAstronomy: Guard aganst null FFT measurement
RadioAstronomyGUI::spectrumSeries_clicked() called
calcVrAndDistanceToPeak() without verifying that currentFFT() returned a
valid FFTMeasurement. Since currentFFT() can return nullptr and
calcVrAndDistanceToPeak() immediately dereferences the pointer, this could
result in a null pointer dereference.

Guard the calls so they are only made when a valid FFT measurement is
available, matching the existing pattern used elsewhere in the class.

Reported by Coverity (CID 649213).

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 19:52:58 -04:00
Edouard Griffiths 2d8182bef2 Merge pull request #2825 from rgetz/rgetz-remove-mallocfail
ft8: replace temporary malloc buffer with std::vector
2026-07-22 17:08:44 +02:00
Edouard Griffiths ff3838d412 Merge pull request #2824 from rgetz/rgetz-paperbag-bug
Fix built-in device selection regression
2026-07-22 14:41:08 +02:00
Edouard Griffiths ce4f6b1a25 Merge pull request #2823 from gretel/yaml-actions-fix
Fix missing YAML-to-SWG mappings for MeshCore plugins
2026-07-22 10:55:55 +02:00
Edouard Griffiths 31580ca25a Merge pull request #2821 from srcejon/fix_2819
APRS: Fix memory leak.
2026-07-22 05:18:09 +02:00
Edouard Griffiths def2eb68a5 Merge pull request #2820 from rgetz/rgetz-remove-check-meshcoredemodgui
Remove redundant ui null check in MeshcoreDemodGUI
2026-07-22 04:30:14 +02:00
Edouard Griffiths a6ad52716e Merge pull request #2818 from rgetz/rgetz-fix-uninitialized-1
Fix Coverity UNINIT warnings in RadioAstronomy and VOR Localizer
2026-07-22 02:12:35 +02:00