aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-15 11:51:47 +0100
committerScott Anderson <scott@anderso.nz>2019-12-16 01:24:28 +0000
commit98cd11c019e19e3abbc9685fcbc0ec855a4f7531 (patch)
tree0019c38c072b811cd9cf4b44ceca815e1a9f713d
parent7fc58e704a36c4a2b30ddf2f8e0ab935b4f10b96 (diff)
output: fix wlr_output_preferred_mode fallback
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: https://github.com/swaywm/sway/issues/4717
-rw-r--r--types/wlr_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index ec29da4f..c9f14688 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -406,7 +406,7 @@ struct wlr_output_mode *wlr_output_preferred_mode(struct wlr_output *output) {
}
// No preferred mode, choose the last one
- return mode;
+ return wl_container_of(output->modes.prev, mode, link);
}
static void output_state_clear_buffer(struct wlr_output_state *state) {