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:
parent
4ba340cfaa
commit
32603f57ca
|
@ -446,6 +446,9 @@ RRFirstOutput(ScreenPtr pScreen)
|
||||||
RROutputPtr output;
|
RROutputPtr output;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
if (!pScrPriv)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
|
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
|
||||||
return pScrPriv->primaryOutput;
|
return pScrPriv->primaryOutput;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user