Fix check for invalid motionType values

This commit is contained in:
Cameron Gutman committed 2026-11-12 22:04:20 -06:00
1 parent dc09c9f2e8
commit f0df33caf8
1 file changed
+2 -1
+2 -1
View File
@@ -1628,7 +1628,8 @@ int LiSendControllerMotionEvent(uint8_t controllerNumber, uint8_t motionType, fl
}
// Check for valid motion type values
if (motionType - 1 >= MAX_MOTION_EVENTS) {
if (motionType <= 0 || motionType - 1 >= MAX_MOTION_EVENTS) {
LC_ASSERT(motionType > 0);
LC_ASSERT(motionType - 1 < MAX_MOTION_EVENTS);
return -3;
}