diff options
author | Alynx Zhou <alynx.zhou@gmail.com> | 2019-11-08 15:10:43 +0800 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-11-08 08:48:30 +0100 |
commit | aa9ea95e1fffde31be72ffaf204a3aaf2893858e (patch) | |
tree | c98f4ca9127ef203ebb18859bf1089c7cd4a9073 | |
parent | 447835afc108fe17906a5acaecc65666786df1ab (diff) |
Skip assign when sub_x or sub_y is NULL in wlr_surface_surface_at
-rw-r--r-- | types/wlr_surface.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c index ca10e08b..9503b8d4 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -1016,8 +1016,12 @@ struct wlr_surface *wlr_surface_surface_at(struct wlr_surface *surface, } if (wlr_surface_point_accepts_input(surface, sx, sy)) { - *sub_x = sx; - *sub_y = sy; + if (sub_x) { + *sub_x = sx; + } + if (sub_y) { + *sub_y = sy; + } return surface; } |