randr: first check pScrPriv before using the pointer at RRFirstOutput

Fix a seg fault in case pScrPriv is NULL at ProcRRGetScreenInfo,
which later calls RRFirstOutput.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Ricardo Salveti de Araujo 2012-06-21 00:55:53 -03:00 committed by Keith Packard
parent 4ba340cfaa
commit 32603f57ca

View File

@ -446,6 +446,9 @@ RRFirstOutput(ScreenPtr pScreen)
RROutputPtr output;
int i, j;
if (!pScrPriv)
return NULL;
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
return pScrPriv->primaryOutput;