diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c index d3dcfa5bda0..6ac67f40ad5 100644 --- a/dlls/winmm/joystick.c +++ b/dlls/winmm/joystick.c @@ -325,7 +325,7 @@ MMRESULT WINAPI joySetThreshold(UINT wID, UINT wThreshold) { TRACE("(%04X, %d);\n", wID, wThreshold); - if (wID >= MAXJOYSTICK) return MMSYSERR_INVALPARAM; + if (wID >= MAXJOYSTICK || wThreshold > 65535) return MMSYSERR_INVALPARAM; JOY_Sticks[wID].threshold = wThreshold;