mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-19 17:00:36 +01:00
modes: check the crtc is valid before using its desired modes.
this fixes a crash I was getting on radeon rotate when gnome is running.
I'm sure g-s-d was doing something bad, but really not crashing ftw.
(cherry picked from commit 1771edcb44)
This commit is contained in:
parent
e9f83740e3
commit
793ff6754e
1 changed files with 5 additions and 3 deletions
|
|
@ -1705,9 +1705,11 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
|
|||
/* Set scrn->modes to the mode list for the 'compat' output */
|
||||
scrn->modes = xf86DuplicateModes(scrn, output->probed_modes);
|
||||
|
||||
for (mode = scrn->modes; mode; mode = mode->next)
|
||||
if (xf86ModesEqual (mode, &crtc->desiredMode))
|
||||
break;
|
||||
if (crtc) {
|
||||
for (mode = scrn->modes; mode; mode = mode->next)
|
||||
if (xf86ModesEqual (mode, &crtc->desiredMode))
|
||||
break;
|
||||
}
|
||||
|
||||
if (scrn->modes != NULL) {
|
||||
/* For some reason, scrn->modes is circular, unlike the other mode
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue