sna: Catch NULL RandR screen private

If Xinerama is enabled, than RandR12 will be silently disabled. Be
careful not to dereference the rrScrPiv when it doesn't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87207
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-12-11 08:53:54 +00:00
parent 04a09d353f
commit f587d71f3c
1 changed files with 4 additions and 2 deletions

View File

@ -1075,8 +1075,10 @@ sna_mode_init(struct sna *sna, ScreenPtr screen)
/* Wrap RR queries to catch pending MST topology changes */
rp = rrGetScrPriv(screen);
sna->mode.rrGetInfo = rp->rrGetInfo;
rp->rrGetInfo = sna_randr_getinfo;
if (rp) {
sna->mode.rrGetInfo = rp->rrGetInfo;
rp->rrGetInfo = sna_randr_getinfo;
}
return TRUE;
}