Merge pull request #22189 from hrydgard/debug-input-rewind-overflows

Fix three more out-of-bounds writes (minor)
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2026-08-31 17:53:10 +02:00
commit 56bba5f6f5
8 files changed
+46 -40

No files matched your search

+4 -1
View File
@@ -683,7 +683,10 @@ void ControlMapper::Axis(const AxisInput *axes, size_t count) {
if (deviceIndex < (size_t)DEVICE_ID_COUNT) {
deviceTimestamps_[deviceIndex] = now;
}
rawAxisValue_[axis.axisId] = axis.value; // these are only used for co-axis mapping
// Same as deviceId above, axisId comes straight from the device and can be out of range.
if ((size_t)axis.axisId < JOYSTICK_AXIS_MAX) {
rawAxisValue_[axis.axisId] = axis.value; // these are only used for co-axis mapping
}
if (axis.value >= 0.0f) {
InputMapping mapping(axis.deviceId, axis.axisId, 1);
InputMapping opposite(axis.deviceId, axis.axisId, -1);