mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-27 08:14:21 +00:00
Fix check for invalid motionType values
This commit is contained in:
1 parent
dc09c9f2e8
commit
f0df33caf8
1 file changed
+2
-1
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user