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.
This commit is contained in:
parent
969f1db96b
commit
ff49f5944d
|
@ -494,7 +494,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = crtc->scrn;
|
ScrnInfoPtr pScrn = crtc->scrn;
|
||||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
|
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;
|
PictTransform crtc_to_fb, fb_to_crtc;
|
||||||
|
|
||||||
PictureTransformIdentity (&crtc_to_fb);
|
PictureTransformIdentity (&crtc_to_fb);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user