diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-17 14:17:37 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-17 14:17:37 +0100 |
commit | 4574b97752af4631a24121b4620786033a4f8651 (patch) | |
tree | 5dfcb8868634277eef489d8c465c57fa23a02acd /platform/android | |
parent | f0c9ed4b55168369bde54ced9c13498fb366af1f (diff) |
Fix crash with bogus shape index to DisplayServer.cursor_set_custom_image()
Fixes #66605.
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/display_server_android.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index 3fcb926f86..af4ba1255b 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -656,6 +656,7 @@ void DisplayServerAndroid::_cursor_set_shape_helper(CursorShape p_shape, bool fo } void DisplayServerAndroid::cursor_set_shape(DisplayServer::CursorShape p_shape) { + ERR_FAIL_INDEX(p_shape, CURSOR_MAX); _cursor_set_shape_helper(p_shape); } @@ -664,6 +665,7 @@ DisplayServer::CursorShape DisplayServerAndroid::cursor_get_shape() const { } void DisplayServerAndroid::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) { + ERR_FAIL_INDEX(p_shape, CURSOR_MAX); String cursor_path = p_cursor.is_valid() ? p_cursor->get_path() : ""; if (!cursor_path.is_empty()) { cursor_path = ProjectSettings::get_singleton()->globalize_path(cursor_path); |