modes: Protect xf86_crtc_supports_gamma() from non-RandR 1.2 drivers.

This commit is contained in:
Eric Anholt 2009-01-30 20:10:21 -08:00
parent 317f2b4a9f
commit f716e3f344

View File

@ -3155,10 +3155,11 @@ xf86_crtc_notify(ScreenPtr screen)
Bool
xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
{
if (xf86CrtcConfigPrivateIndex != -1) {
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86CrtcPtr crtc;
if ((xf86CrtcConfigPrivateIndex == -1) || !xf86_config)
if (!xf86_config)
return FALSE;
if (xf86_config->num_crtc == 0)
@ -3166,4 +3167,7 @@ xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
crtc = xf86_config->crtc[0];
return (crtc->funcs->gamma_set != NULL);
}
return FALSE;
}