From aa9ea95e1fffde31be72ffaf204a3aaf2893858e Mon Sep 17 00:00:00 2001 From: Alynx Zhou Date: Fri, 8 Nov 2019 15:10:43 +0800 Subject: Skip assign when sub_x or sub_y is NULL in wlr_surface_surface_at --- types/wlr_surface.c | 8 ++++++-- 1 file 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; } -- cgit v1.2.3