From 5661ac1cd216485ff0fa6df037cb9fa523ecd706 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Thu, 22 Jan 2026 11:21:29 +0100 Subject: [PATCH] output-swapchain-manager: Reject zero resolution If an output with no mode and no valid pending resolution is attempted enabled, it will trigger an assert in swapchain allocation instead of failing on a rejected atomic commit or pre-commit test. We can sometimes get such broken outputs if e.g., the underlying driver failed to retrieve EDID, and so crashing on assert is suboptimal. Reject zero-sized swapchains early and log the issue. --- types/wlr_output_swapchain_manager.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/wlr_output_swapchain_manager.c b/types/wlr_output_swapchain_manager.c index 9df3a6524..d91d5f510 100644 --- a/types/wlr_output_swapchain_manager.c +++ b/types/wlr_output_swapchain_manager.c @@ -108,6 +108,10 @@ static bool manager_output_prepare(struct wlr_output_swapchain_manager_output *m int width, height; output_pending_resolution(output, state, &width, &height); + if (width == 0 || height == 0) { + wlr_log(WLR_DEBUG, "Cannot allocate swapchain for zero resolution (%dx%d)", width, height); + return false; + } uint32_t fmt = output->render_format; if (state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) {