diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-26 19:53:36 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-04-27 20:36:03 +0200 |
commit | 3a04fb4560cf60c34bd968fe711a45d42993e5a4 (patch) | |
tree | 14cb8dc4870c4fb495986d025496892657419dd3 /render/pixman | |
parent | 24fde77c620f7fceb62da17163ab71ea3921d373 (diff) |
render/pixman: check format is supported in create_buffer
Diffstat (limited to 'render/pixman')
-rw-r--r-- | render/pixman/renderer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/render/pixman/renderer.c b/render/pixman/renderer.c index e50b774f..d85c11a1 100644 --- a/render/pixman/renderer.c +++ b/render/pixman/renderer.c @@ -91,7 +91,12 @@ static struct wlr_pixman_buffer *create_buffer( goto error_buffer; } - uint32_t format = get_pixman_format_from_drm(drm_format); + pixman_format_code_t format = get_pixman_format_from_drm(drm_format); + if (format == 0) { + wlr_log(WLR_ERROR, "Unsupported pixman drm format 0x%"PRIX32, + drm_format); + return NULL; + } buffer->image = pixman_image_create_bits(format, wlr_buffer->width, wlr_buffer->height, data, stride); |