mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-25 03:24:18 -04:00
af4c366cb7
Add defensive null checks before dereferencing DeviceAPI::getBuddySharedPtr() in the PlutoSDR input and output plugins. DeviceAPI initializes the buddy shared pointer to nullptr, so a buddy may exist before its shared state has been attached. This could result in null pointer dereferences during device initialization, buddy thread suspend/resume, or settings application. Changes include: - Validate buddy shared pointer in openDevice() and fail gracefully if absent. - Guard suspendBuddies() and resumeBuddies() against null shared pointers. - Skip buddies without shared state during applySettings() while logging a warning. - Prevent dereferencing null buddy shared pointers when restarting buddy threads. These changes improve robustness during PlutoSDR buddy initialization and avoid crashes caused by partially initialized buddy relationships. Signed-off-by: Robin Getz <rgetz503@gmail.com>