From cc1c69c9d8741b2d4b29645c0d0ab066421f019c 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 8de7fcbc3..f8ad58de2 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -674,8 +674,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;