]> git.pld-linux.org Git - packages/XFree86.git/blame - XFree86-VidMode-nocrashafterfailure.patch
- outdated
[packages/XFree86.git] / XFree86-VidMode-nocrashafterfailure.patch
CommitLineData
95db7ec1
JB
1X server used to crash after XF86VidModeSwitchToMode() failure,
2because of unconditional currentMode info destruction.
3
4E.g. (the case I investigated) when screen resolution set by RandR was
5lower than requested by XF86VidModeSwitchToMode(), xf86SwitchMode is
6unsuccessful; due to currentMode == NULL (in some way) DRIAdjustFrame()
7called itself recursively again and again, leading to stack overflow.
8
9This patch seems to avoid the crash.
10
11--- XFree86-4.3.0/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c.orig Tue Jan 28 21:52:28 2003
12+++ XFree86-4.3.0/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c Sat Mar 8 01:05:00 2003
13@@ -330,6 +330,8 @@
14 VidModeSwitchMode(int scrnIndex, pointer mode)
15 {
16 ScrnInfoPtr pScrn;
17+ DisplayModePtr pTmpMode;
18+ Bool retval;
19
20 DEBUG_P("VidModeSwitchMode");
21
22@@ -338,8 +340,12 @@
23
24 pScrn = xf86Screens[scrnIndex];
25 /* Force a mode switch */
26+ pTmpMode = pScrn->currentMode;
27 pScrn->currentMode = NULL;
28- return xf86SwitchMode(pScrn->pScreen, mode);
29+ retval = xf86SwitchMode(pScrn->pScreen, mode);
30+ if (retval == FALSE)
31+ pScrn->currentMode = pTmpMode;
32+ return retval;
33 }
34
35 Bool
This page took 0.0537 seconds and 4 git commands to generate.