Commit e5abaf9f authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Alexandre Julliard

dinput: Clamp lMagnitude to -10000..10000 range.

parent 15a33ab2
......@@ -664,7 +664,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
if (peff->cbTypeSpecificParams != sizeof(DICONSTANTFORCE))
return DIERR_INVALIDPARAM;
tsp = (LPCDICONSTANTFORCE)(peff->lpvTypeSpecificParams);
This->effect.u.constant.level = (tsp->lMagnitude / 10) * 32;
This->effect.u.constant.level = (max(min(tsp->lMagnitude, 10000), -10000) / 10) * 32;
} else if (type == DIEFT_RAMPFORCE) {
LPCDIRAMPFORCE tsp;
if (peff->cbTypeSpecificParams != sizeof(DIRAMPFORCE))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment