From 5d054258af1bbdad43758d0161ef4ca10f41aaec Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 12 Jan 2021 11:41:45 +0100 Subject: [PATCH] backend/drm: fix segfault in page_flip_handler Since 5b1b43c68c7a ("backend/drm: make wlr_drm_plane.{pending,queued,current}_fb pointers"), current_fb can be NULL if there's no buffer. If current_fb is not NULL, current_fb->wlr_buf is guaranteed to not be NULL. Closes: https://github.com/swaywm/wlroots/issues/2634 --- backend/drm/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 6b6e49a6..b58241af 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -1484,7 +1484,7 @@ static void page_flip_handler(int fd, unsigned seq, * data between the GPUs, even if we were using the direct scanout * interface. */ - if (!drm->parent && plane->current_fb->wlr_buf && + if (!drm->parent && plane->current_fb && wlr_client_buffer_get(plane->current_fb->wlr_buf)) { present_flags |= WLR_OUTPUT_PRESENT_ZERO_COPY; }