diff options
author | Alex Deucher <alex@samba.(none)> | 2008-01-03 22:53:36 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-07-29 18:40:44 -0700 |
commit | ff49f5944d06b17fb904c4f64b8660aab60d8d0d (patch) | |
tree | 399bf601bab93f8c3782c14c4cb994e50232455b | |
parent | 969f1db96b03afa51dacce466320d311e5c9ce72 (diff) |
Fix potential crasher in xf86CrtcRotate()server-1.4-branch
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.
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index dd0e6598e..e2d6295b9 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); |