xserver: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Thu Jan 3 19:53:43 PST 2008


 hw/xfree86/modes/xf86Rotate.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 20eb26f9d149993ae360a2cbd1b536b68c9f4069
Author: Alex Deucher <alex at samba.(none)>
Date:   Thu Jan 3 22:53:36 2008 -0500

    Fix potential crasher in xf86CrtcRotate()
    
    xf86CrtcRotate() is called by randr 1.2 drivers via xf86CrtcSetMode() or xf86SetDesiredModes()
    during ScreenInit() at which point pScrn->pScreen is not set. If a user specifies a rotation
    in their config file pScrn->pScreen is dereferenced and boom.

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 380478f..c129d9b 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -494,7 +494,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
 {
     ScrnInfoPtr		pScrn = crtc->scrn;
     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-    ScreenPtr		pScreen = pScrn->pScreen;
+    /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
+    ScreenPtr		pScreen = screenInfo.screens[pScrn->scrnIndex];
     PictTransform	crtc_to_fb, fb_to_crtc;
     
     PictureTransformIdentity (&crtc_to_fb);


More information about the xorg-commit mailing list