=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: winmm: Respect return value from joyGetPos (Coverity).
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Dec 23 18:22:07 CST 2015
Module: wine
Branch: master
Commit: 64f600fe2266f964c912eb4d08a6fc1247a47eb1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=64f600fe2266f964c912eb4d08a6fc1247a47eb1
Author: André Hentschel <nerv at dawncrow.de>
Date: Tue Dec 22 23:18:52 2015 +0100
winmm: Respect return value from joyGetPos (Coverity).
Signed-off-by: André Hentschel <nerv at dawncrow.de>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 6ac67f4..8a52942 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 ||
More information about the wine-cvs
mailing list