From 9299f9f1d89870bc561d83187896494a29cdcd46 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 5 Apr 2019 10:02:51 -0700 Subject: [PATCH] Avoid left shift of 32-bit value by more than 31 --- src/msw/joystick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/joystick.cpp b/src/msw/joystick.cpp index 761477f833..99f03f1285 100644 --- a/src/msw/joystick.cpp +++ b/src/msw/joystick.cpp @@ -261,7 +261,7 @@ int wxJoystick::GetButtonState() const bool wxJoystick::GetButtonState(unsigned id) const { - if (id > sizeof(int) * 8) + if (id >= sizeof(int) * 8) return false; return (GetButtonState() & (1 << id)) != 0;