mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-05 04:06:11 -05:00
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.
This commit is contained in:
parent
91c08d5a53
commit
5661ac1cd2
1 changed files with 4 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue