From 0260f042d2218f0ca805c877ac6f0dc446937ce8 Mon Sep 17 00:00:00 2001 From: vilhalmer Date: Sun, 8 Jul 2018 12:35:41 -0400 Subject: [PATCH] Bail from setting gamma on destroyed resource --- types/wlr_gamma_control.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/wlr_gamma_control.c b/types/wlr_gamma_control.c index 61c058c4..0f74e59a 100644 --- a/types/wlr_gamma_control.c +++ b/types/wlr_gamma_control.c @@ -51,6 +51,10 @@ static void gamma_control_set_gamma(struct wl_client *client, struct wlr_gamma_control *gamma_control = gamma_control_from_resource(gamma_control_resource); + if (gamma_control == NULL) { + return; + } + if (red->size != green->size || red->size != blue->size) { wl_resource_post_error(gamma_control_resource, GAMMA_CONTROL_ERROR_INVALID_GAMMA,