From 428f6e93d678cd88b58986f5994f654097af6bc9 Mon Sep 17 00:00:00 2001 From: Joe Andaverde Date: Sun, 5 Jul 2026 09:10:53 -0500 Subject: [PATCH] Fix PinscapePico crash when the configured device is not connected UpdateOutputs indexes m_oldOutputValues (resized only on a successful connect) and lacked the !m_dev guard the sibling Pinscape has. A configured-but-absent Pico leaves m_dev null, m_oldOutputValues empty, GetNumberOfOutputs()=128, so the first update reads m_oldOutputValues[0] out of bounds and crashes. C# binds the device in the Number setter (Devices.First throws if absent), so it cannot reach this state. Add the !m_dev guard, matching Pinscape::UpdateOutputs. --- src/cab/out/pspico/PinscapePico.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cab/out/pspico/PinscapePico.cpp b/src/cab/out/pspico/PinscapePico.cpp index 7ce872b..b38abf1 100644 --- a/src/cab/out/pspico/PinscapePico.cpp +++ b/src/cab/out/pspico/PinscapePico.cpp @@ -306,6 +306,9 @@ class ContiguousOutputListGroup : public OutputListGroup void PinscapePico::UpdateOutputs(const std::vector& newOutputValues) { + if (!m_dev) + return; + ContiguousOutputListGroup contiguousGroup; RandomAccessOutputListGroup randomGroup; int firstChangedIndex = -1;