From f97571fb1ffe52d4385451ef50a73ffe62a05c4f Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Wed, 6 May 2026 01:05:53 -0400 Subject: [PATCH] [sim] GUI: fix memory corruption and incorrect POV count (#8853) Fixes #8800 and fixes #8801. --- .../halsim_gui/src/main/native/cpp/DriverStationGui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp b/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp index 7a67cb0193..f00b3614d7 100644 --- a/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp @@ -203,7 +203,7 @@ class JoystickModel { std::unique_ptr axes[HAL_MAX_JOYSTICK_AXES]; // use pointer instead of unique_ptr to allow it to be passed directly // to DrawLEDSources() - wpi::glass::BooleanSource* buttons[32]; + wpi::glass::BooleanSource* buttons[64]; std::unique_ptr povs[HAL_MAX_JOYSTICK_POVS]; private: @@ -1477,7 +1477,7 @@ static void DisplayJoysticks() { } uint8_t povCount = - static_cast(16 - std::countl_zero(joy.data.povs.available)); + static_cast(8 - std::countl_zero(joy.data.povs.available)); for (int j = 0; j < povCount; ++j) { if (source && source->povs[j]) {