From 2419a4e4ffd494c3f22d9736a1fd4d67e016b474 Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Thu, 22 Jun 2017 11:52:11 -0300 Subject: Fix possible crash in joy_axis (fixes #4944). --- main/input_default.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main') 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) { -- cgit v1.2.3