backend: gl: handle blur context creation failure

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-11-17 22:16:27 +00:00
parent e61b3ea7a3
commit 706acb78b7
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 5 additions and 0 deletions

View File

@ -1182,6 +1182,11 @@ struct backend_shadow_context *gl_create_shadow_context(backend_t *base, double
.deviation = gaussian_kernel_std_for_size(radius, 0.5 / 256.0),
};
ctx->blur_context = gl_create_blur_context(base, BLUR_METHOD_GAUSSIAN, &args);
if (!ctx->blur_context) {
log_error("Failed to create shadow context");
free(ctx);
return NULL;
}
}
return (struct backend_shadow_context *)ctx;
}