Merge pull request #1120 from vilhalmer/gamma-control-set-bail-on-destroyed-resource

Bail from setting gamma on destroyed resource
This commit is contained in:
emersion 2018-07-08 19:08:29 +01:00 committed by GitHub
commit 66ac9e7f49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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,