aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/renderer.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-05-26 09:38:48 +0200
committerSimon Ser <contact@emersion.fr>2022-05-26 09:38:48 +0200
commit2e69eb10303f3074d6cafef30e7e1ce49cb7a1ac (patch)
treec91b3482f8098aff76c0ed4d4229c4017e932b47 /backend/drm/renderer.c
parent1cb6b2cf673a5b580d7ad79ce2b37c14b14b0268 (diff)
backend/drm: fix crash in init_drm_surface
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434
Diffstat (limited to 'backend/drm/renderer.c')
-rw-r--r--backend/drm/renderer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 60155313..9e1de3d0 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -61,7 +61,8 @@ static void finish_drm_surface(struct wlr_drm_surface *surf) {
bool init_drm_surface(struct wlr_drm_surface *surf,
struct wlr_drm_renderer *renderer, int width, int height,
const struct wlr_drm_format *drm_format) {
- if (surf->swapchain->width == width && surf->swapchain->height == height) {
+ if (surf->swapchain != NULL && surf->swapchain->width == width &&
+ surf->swapchain->height == height) {
return true;
}