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
2026-08-31 17:53:10 +02:00
committed by GitHub
8 changed files with 46 additions and 40 deletions
+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);