diff options
author | Simon Ser <contact@emersion.fr> | 2019-12-15 11:51:47 +0100 |
---|---|---|
committer | Scott Anderson <scott@anderso.nz> | 2019-12-16 01:24:28 +0000 |
commit | 98cd11c019e19e3abbc9685fcbc0ec855a4f7531 (patch) | |
tree | 0019c38c072b811cd9cf4b44ceca815e1a9f713d | |
parent | 7fc58e704a36c4a2b30ddf2f8e0ab935b4f10b96 (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.c | 2 |
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) { |