summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2017-06-22 11:52:11 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2017-06-22 11:52:11 -0300
commit2419a4e4ffd494c3f22d9736a1fd4d67e016b474 (patch)
treed4fe5fb514da0c479d96baf6314c142f2f0cf1a0 /main
parent57ebad28a934361c52c84b7b010b1d983cce3efc (diff)
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) {