Make xf86CompatOutput() return NULL when there are no privates

Some drivers (mach64 w/o DRI for instance) don't initialize privates.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
This commit is contained in:
Matthieu Herrb 2021-10-31 11:28:28 +01:00 committed by Povilas Kanapickas
parent b656b0aa5d
commit 80eeff3eba

View File

@ -839,6 +839,9 @@ xf86CompatOutput(ScrnInfoPtr pScrn)
{ {
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
if (xf86CrtcConfigPrivateIndex == -1)
return NULL;
if (config->compat_output < 0) if (config->compat_output < 0)
return NULL; return NULL;
return config->output[config->compat_output]; return config->output[config->compat_output];