From 341154a5f678400f2ebc96004250e68443c3d607 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Wed, 1 May 2024 03:07:16 +0300 Subject: [PATCH] alpha-modifier-v1: add a missing NULL check in wlr_alpha_modifier_v1_get_surface_state() --- types/wlr_alpha_modifier_v1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/wlr_alpha_modifier_v1.c b/types/wlr_alpha_modifier_v1.c index 921b9412..7344e181 100644 --- a/types/wlr_alpha_modifier_v1.c +++ b/types/wlr_alpha_modifier_v1.c @@ -181,5 +181,8 @@ struct wlr_alpha_modifier_v1 *wlr_alpha_modifier_v1_create(struct wl_display *di const struct wlr_alpha_modifier_surface_v1_state *wlr_alpha_modifier_v1_get_surface_state( struct wlr_surface *wlr_surface) { struct wlr_alpha_modifier_surface_v1 *surface = surface_from_wlr_surface(wlr_surface); + if (surface == NULL) { + return NULL; + } return &surface->current; }