Avoid dereferencing NULL pScreen in xf86CrtcSetModeTransform().

We can get there during PreInit as we set a mode for load detection.
At that time there's no pScreen anywhere, so just skip the optimization
then.
This commit is contained in:
Kristian Høgsberg 2008-12-01 12:41:10 -05:00
parent b0d371ab0a
commit 09df7cc5ad

View File

@ -294,10 +294,14 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
} else } else
crtc->transformPresent = FALSE; crtc->transformPresent = FALSE;
/* xf86CrtcFitsScreen() relies on these values being correct. */ /* We may hit this path during PreInit during load-detcect, at
/* This should ensure the values are always set at modeset time. */ * which point no pScreens exist yet, so avoid this step. */
pScreen->width = scrn->virtualX; if (pScreen) {
pScreen->height = scrn->virtualY; /* xf86CrtcFitsScreen() relies on these values being correct. */
/* This should ensure the values are always set at modeset time. */
pScreen->width = scrn->virtualX;
pScreen->height = scrn->virtualY;
}
/* Shift offsets that move us out of virtual size */ /* Shift offsets that move us out of virtual size */
if (x + mode->HDisplay > xf86_config->maxWidth || if (x + mode->HDisplay > xf86_config->maxWidth ||