From 64f600fe2266f964c912eb4d08a6fc1247a47eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Tue, 22 Dec 2015 23:18:52 +0100 Subject: [PATCH] winmm: Respect return value from joyGetPos (Coverity). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Hentschel Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/winmm/joystick.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c index 6ac67f40ad5..8a52942ca65 100644 --- a/dlls/winmm/joystick.c +++ b/dlls/winmm/joystick.c @@ -84,6 +84,7 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT_PTR wTimer, DWORD dwTi { int i; WINE_JOYSTICK* joy; + MMRESULT res; JOYINFO ji; LONG pos; unsigned buttonChange; @@ -93,7 +94,12 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT_PTR wTimer, DWORD dwTi if (joy->hCapture != hWnd) continue; - joyGetPos(i, &ji); + res = joyGetPos(i, &ji); + if (res != JOYERR_NOERROR) { + WARN("joyGetPos failed: %08x\n", res); + continue; + } + pos = MAKELONG(ji.wXpos, ji.wYpos); if (!joy->bChanged ||