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>
(cherry picked from commit 32603f57ca)
This commit is contained in:
Ricardo Salveti de Araujo 2012-06-21 00:55:53 -03:00 committed by Jeremy Huddleston Sequoia
parent b348cfd4b8
commit ba0fe0092c

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;