From 743af2216d2dcaa3fd2b2350f977257f8a930a49 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 f8ad58de2..0b72b487b 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -659,6 +659,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);