Commit 32789799 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

dinput: Do not read/write past the struct for old DX versions.

Based on ideas by Elias Vanderstuyft. Signed-off-by: 's avatarBruno Jesus <00cpxxx@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 844a25ab
......@@ -329,9 +329,8 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters(
peff->dwSamplePeriod = 0;
}
if (dwFlags & DIEP_STARTDELAY) {
if ((dwFlags & DIEP_STARTDELAY) && peff->dwSize > sizeof(DIEFFECT_DX5))
peff->dwStartDelay = This->effect.replay.delay * 1000;
}
if (dwFlags & DIEP_TRIGGERBUTTON) {
FIXME("LinuxInput button mapping needs redoing; for now, assuming we're using an actual joystick.\n");
......@@ -570,6 +569,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
TRACE("Sample period requested but no sample period functionality present.\n");
if (dwFlags & DIEP_STARTDELAY)
if ((dwFlags & DIEP_STARTDELAY) && peff->dwSize > sizeof(DIEFFECT_DX5))
This->effect.replay.delay = peff->dwStartDelay / 1000;
if (dwFlags & DIEP_TRIGGERBUTTON) {
......
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