summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClay John <claynjohn@gmail.com>2023-03-11 17:53:37 -0800
committerGitHub <noreply@github.com>2023-03-11 17:53:37 -0800
commit550a7798510810d238b733a54f69da71b2a2d152 (patch)
tree7d9ccb1d2c7ee28f0fe7015d52a0ca7cb59ab541
parentb31d00a9144a481b25d078b1b3ed6ff55c0e3a48 (diff)
parentd186b7438f8ced5e79a7081a29e720d1683cd267 (diff)
downloadredot-engine-550a7798510810d238b733a54f69da71b2a2d152.tar.gz
Merge pull request #74781 from Malcolmnixon/gles3_android
Fix null-pointer dereference on Android systems when using gl_compatibility renderer
-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() {