From 3ae9c80ddf4a723b0ee5262314ff95c0992f9539 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Wed, 6 Dec 2023 02:22:35 -0500 Subject: [PATCH] wlr_output: Don't allow commits changing render format without a buffer --- types/output/output.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/output/output.c b/types/output/output.c index e73cc1b69..83e9653cc 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -621,6 +621,12 @@ static bool output_basic_test(struct wlr_output *output, } } + if ((state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) && + (state->committed & WLR_OUTPUT_STATE_BUFFER) == 0) { + wlr_log(WLR_DEBUG, "Tried to change the render format without a buffer."); + return false; + } + if (state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) { struct wlr_allocator *allocator = output->allocator; assert(allocator != NULL);