aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-07-08 19:08:29 +0100
committerGitHub <noreply@github.com>2018-07-08 19:08:29 +0100
commit66ac9e7f49304ff24ac58f7b5443a253fd86a7bd (patch)
treea1ac9b5f920938e9cb55c4c2d4234ac99e9a8eb3
parentc1a6422b332887cb0af40e659d61652ecfa1d030 (diff)
parent0260f042d2218f0ca805c877ac6f0dc446937ce8 (diff)
Merge pull request #1120 from vilhalmer/gamma-control-set-bail-on-destroyed-resource
Bail from setting gamma on destroyed resource
-rw-r--r--types/wlr_gamma_control.c4
1 files changed, 4 insertions, 0 deletions
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,