Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-14 10:35:29 +0300
committerCampbell Barton <campbell@blender.org>2022-06-14 10:36:18 +0300
commitc1d295e905f9fb4a05218bf2db674e7739b179a6 (patch)
tree0669f993423ba3b9b2fa560376d1bc9851fc4a27
parente1f15e3b323e9e0dd4a2514395934ec44969ecfb (diff)
Fix crash in 827fa8176737f822b7f8d2354b05e59976c7101a
Missing null pointer check.
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 9e683ceb437..49342110df7 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -2163,6 +2163,10 @@ GHOST_TSuccess GHOST_SystemWayland::getCursorPosition(int32_t &x, int32_t &y) co
}
GHOST_WindowWayland *win = static_cast<GHOST_WindowWayland *>(wl_surface_get_user_data(surface));
+ if (!win) {
+ return GHOST_kFailure;
+ }
+
const wl_fixed_t scale = win->scale();
x = wl_fixed_to_int(scale * input->xy[0]);
y = wl_fixed_to_int(scale * input->xy[1]);