mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-11-28 00:34:26 +00:00
Avoid potential overflow in gamepad sensor report rate period
This commit is contained in:
1 parent
136610d5fd
commit
dab3e23cc4
2 files changed
+3
-3
No files matched your search
@@ -931,7 +931,7 @@ void SdlInputHandler::setMotionEventState(uint16_t controllerNumber, uint8_t mot
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 14)
|
||||
if (m_GamepadState[controllerNumber].controller != nullptr) {
|
||||
uint8_t reportPeriodMs = reportRateHz ? (1000 / reportRateHz) : 0;
|
||||
uint32_t reportPeriodMs = reportRateHz ? SDL_max(1000U / reportRateHz, 1U) : 0;
|
||||
|
||||
switch (motionType) {
|
||||
case LI_MOTION_TYPE_ACCEL:
|
||||
|
||||
Reference in new issue
Block a user