Skip to content

Commit

Permalink
output: fix wlr_output_preferred_mode fallback
Browse files Browse the repository at this point in the history
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
  • Loading branch information
emersion authored and aiqs4 committed Dec 19, 2019
1 parent a695707 commit 89a125b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/wlr_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 89a125b

Please sign in to comment.