mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-21 12:20:45 +02:00
DDX/Randr: Avoid server crash when xrandr SetConfig is called while switched away
A call to Xrandr SetScreenConfig (for randr 1.1) causes the Xserver to
crash when xf86SetViewport() which does not check if the hardware is
accessible.
Wrap accesses to xf86SetViewport() with if (vtSema) { ... } to avoid that.
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
508e05777a
commit
2aa5092b88
1 changed files with 9 additions and 7 deletions
|
|
@ -214,13 +214,15 @@ xf86RandRSetMode(ScreenPtr pScreen,
|
|||
*/
|
||||
xf86ReconfigureLayout();
|
||||
|
||||
/*
|
||||
* Make sure the whole screen is visible
|
||||
*/
|
||||
xf86SetViewport(pScreen, pScreen->width, pScreen->height);
|
||||
xf86SetViewport(pScreen, 0, 0);
|
||||
if (pRoot && scrp->vtSema)
|
||||
(*scrp->EnableDisableFBAccess) (scrp, TRUE);
|
||||
if (scrp->vtSema) {
|
||||
/*
|
||||
* Make sure the whole screen is visible
|
||||
*/
|
||||
xf86SetViewport (pScreen, pScreen->width, pScreen->height);
|
||||
xf86SetViewport (pScreen, 0, 0);
|
||||
if (pRoot)
|
||||
(*scrp->EnableDisableFBAccess) (scrp, TRUE);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue