Merge pull request #9316 from marcelofg55/master

Fix possible crash in joy_axis (fixes #4944).
This commit is contained in:
Andreas Haas 2017-06-22 16:51:25 +00:00 committed by GitHub
commit bda6f9c167
1 changed files with 2 additions and 0 deletions

View File

@ -874,6 +874,8 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
_THREAD_SAFE_METHOD_; _THREAD_SAFE_METHOD_;
ERR_FAIL_INDEX(p_axis, JOY_AXIS_MAX);
Joypad &joy = joy_names[p_device]; Joypad &joy = joy_names[p_device];
if (joy.last_axis[p_axis] == p_value.value) { if (joy.last_axis[p_axis] == p_value.value) {