diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c index c224bd8ce24..ca43b171a21 100644 --- a/dlls/dinput/effect_linuxinput.c +++ b/dlls/dinput/effect_linuxinput.c @@ -29,6 +29,7 @@ # include # undef SW_MAX #endif +#include #include #ifdef HAVE_UNISTD_H # include @@ -518,7 +519,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_Start( event.type = EV_FF; event.code = This->effect.id; - event.value = dwIterations; + event.value = min( dwIterations, INT_MAX ); if (write(*(This->fd), &event, sizeof(event)) == -1) { FIXME("Unable to write event. Assuming device disconnected.\n"); return DIERR_INPUTLOST;