diff options
author | Rafał Mikrut <mikrutrafal54@gmail.com> | 2020-04-01 19:29:35 +0200 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal54@gmail.com> | 2020-04-01 19:29:35 +0200 |
commit | 359bebd8c08a626e64ade1ac45c3c925352bd8a4 (patch) | |
tree | 83769dbf9cdb5ca7e6dee2e04b95dfc2c1f587c4 /platform/linuxbsd/display_server_x11.cpp | |
parent | 0168709978154a89f137b44f33647e5d28a46250 (diff) |
Fix out of bound array access caused by unassigned variable
Diffstat (limited to 'platform/linuxbsd/display_server_x11.cpp')
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index c2b5657081..786bc37bad 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -3374,6 +3374,15 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode r_error = OK; + current_cursor = CURSOR_ARROW; + mouse_mode = MOUSE_MODE_VISIBLE; + + for (int i = 0; i < CURSOR_MAX; i++) { + + cursors[i] = None; + img[i] = NULL; + } + last_button_state = 0; xmbstring = NULL; @@ -3652,14 +3661,6 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode for (int i = 0; i < CURSOR_MAX; i++) { - cursors[i] = None; - img[i] = NULL; - } - - current_cursor = CURSOR_ARROW; - - for (int i = 0; i < CURSOR_MAX; i++) { - static const char *cursor_file[] = { "left_ptr", "xterm", |