wlr_output: Don't allow commits enabling an output with no buffer

This commit is contained in:
Alexander Orzechowski 2023-09-11 03:28:46 -04:00
parent 9b1bdf7475
commit 3f0a10bad0

View file

@ -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;