mirror of
https://github.com/swaywm/sway.git
synced 2024-12-01 19:06:38 +00:00
Fix segfault in set_mode
best is NULL prior to being assigned to a mode.
Closes: https://github.com/swaywm/sway/issues/4705
Fixes: f33dcd4c60
("Prefer higher refresh rate default modes")
This commit is contained in:
parent
f33dcd4c60
commit
01b5350bdc
|
@ -222,7 +222,9 @@ static bool set_mode(struct wlr_output *output, int width, int height,
|
||||||
best = mode;
|
best = mode;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
best = mode->refresh > best->refresh ? mode : best;
|
if (best == NULL || mode->refresh > best->refresh) {
|
||||||
|
best = mode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!best) {
|
if (!best) {
|
||||||
|
|
Loading…
Reference in a new issue