From 3f0a10bad03796dd8bee8b35c25cb4e19b2bd901 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Mon, 11 Sep 2023 03:28:46 -0400 Subject: [PATCH] wlr_output: Don't allow commits enabling an output with no buffer --- types/output/output.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/output/output.c b/types/output/output.c index c388e8a9b..e73cc1b69 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -636,8 +636,13 @@ static bool output_basic_test(struct wlr_output *output, wlr_drm_format_finish(&format); } - bool enabled = output_pending_enabled(output, state); + if ((state->committed & WLR_OUTPUT_STATE_ENABLED) && state->enabled && + (state->committed & WLR_OUTPUT_STATE_BUFFER) == 0) { + wlr_log(WLR_DEBUG, "Tried to enable an output without a buffer"); + return false; + } + bool enabled = output_pending_enabled(output, state); if (enabled && (state->committed & (WLR_OUTPUT_STATE_ENABLED | WLR_OUTPUT_STATE_MODE))) { int pending_width, pending_height;