mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-25 19:19:02 +00:00
1.26.3.0: Apply bounds and error checking for the joystick configuration (fixes #434)
This commit is contained in:
@@ -817,6 +817,19 @@ void JoySetJoyType(UINT num, DWORD type)
|
||||
if (num > JN_JOYSTICK1)
|
||||
return;
|
||||
|
||||
if (num == JN_JOYSTICK0) // GH#434
|
||||
{
|
||||
_ASSERT(type < J0C_MAX);
|
||||
if (type >= J0C_MAX)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
_ASSERT(type < J1C_MAX);
|
||||
if (type >= J1C_MAX)
|
||||
return;
|
||||
}
|
||||
|
||||
joytype[num] = type;
|
||||
|
||||
// Refresh centre positions whenever 'joytype' changes
|
||||
|
||||
Reference in New Issue
Block a user