winmm: Respect return value from joyGetPos (Coverity)

André Hentschel nerv at dawncrow.de
Mon Nov 23 13:36:42 CST 2015


Signed-off-by: André Hentschel <nerv at dawncrow.de>
---
CID 1261597

 dlls/winmm/joystick.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c
index 6ac67f4..fb30ac8 100644
--- a/dlls/winmm/joystick.c
+++ b/dlls/winmm/joystick.c
@@ -93,7 +93,8 @@ static	void	CALLBACK	JOY_Timer(HWND hWnd, UINT wMsg, UINT_PTR wTimer, DWORD dwTi
 
 	if (joy->hCapture != hWnd) continue;
 
-	joyGetPos(i, &ji);
+       if (joyGetPos(i, &ji) != JOYERR_NOERROR) continue;
+
 	pos = MAKELONG(ji.wXpos, ji.wYpos);
 
 	if (!joy->bChanged ||
-- 
1.9.1




More information about the wine-patches mailing list