summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMalcolm Nixon <Malcolm.nixon@gmail.com>2023-03-11 12:03:55 -0500
committerYuri Sizov <yuris@humnom.net>2023-03-13 14:22:45 +0100
commit5180116c0752163d6954abef61a873b32ae38f30 (patch)
tree9d5aece1c231749a2a7b61624ee14150d83cacc0 /platform
parent0112862e70819f700fd86104a136795fcbe1c80e (diff)
Fix null-pointer dereference on Android systems when using gl_compatibility renderer.
(cherry picked from commit d186b7438f8ced5e79a7081a29e720d1683cd267)
Diffstat (limited to 'platform')
-rw-r--r--platform/android/display_server_android.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp
index af4ba1255b..e07e0e1149 100644
--- a/platform/android/display_server_android.cpp
+++ b/platform/android/display_server_android.cpp
@@ -676,16 +676,19 @@ void DisplayServerAndroid::cursor_set_custom_image(const Ref<Resource> &p_cursor
void DisplayServerAndroid::window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window) {
#if defined(VULKAN_ENABLED)
- context_vulkan->set_vsync_mode(p_window, p_vsync_mode);
+ if (context_vulkan) {
+ context_vulkan->set_vsync_mode(p_window, p_vsync_mode);
+ }
#endif
}
DisplayServer::VSyncMode DisplayServerAndroid::window_get_vsync_mode(WindowID p_window) const {
#if defined(VULKAN_ENABLED)
- return context_vulkan->get_vsync_mode(p_window);
-#else
- return DisplayServer::VSYNC_ENABLED;
+ if (context_vulkan) {
+ return context_vulkan->get_vsync_mode(p_window);
+ }
#endif
+ return DisplayServer::VSYNC_ENABLED;
}
void DisplayServerAndroid::reset_swap_buffers_flag() {