summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAndreas Haas <Hinsbart@users.noreply.github.com>2017-06-22 16:51:25 +0000
committerGitHub <noreply@github.com>2017-06-22 16:51:25 +0000
commitbda6f9c1679b8f27e850df736b0bf7dee515f820 (patch)
treed4fe5fb514da0c479d96baf6314c142f2f0cf1a0 /main
parent57ebad28a934361c52c84b7b010b1d983cce3efc (diff)
parent2419a4e4ffd494c3f22d9736a1fd4d67e016b474 (diff)
Merge pull request #9316 from marcelofg55/master
Fix possible crash in joy_axis (fixes #4944).
Diffstat (limited to 'main')
-rw-r--r--main/input_default.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp
index e488438059..bde1e84926 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -874,6 +874,8 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
_THREAD_SAFE_METHOD_;
+ ERR_FAIL_INDEX(p_axis, JOY_AXIS_MAX);
+
Joypad &joy = joy_names[p_device];
if (joy.last_axis[p_axis] == p_value.value) {