VidMode: prevent crash with no modes

Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=17431

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Chris Wilson 2011-01-24 11:17:03 +00:00 committed by Jeremy Huddleston
parent c1bb8f43b9
commit eeb21a133b

View File

@ -221,6 +221,9 @@ VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock)
return FALSE;
pScrn = xf86Screens[scrnIndex];
if (pScrn->modes == NULL)
return FALSE;
pVidMode = VMPTR(pScrn->pScreen);
pVidMode->First = pScrn->modes;
pVidMode->Next = pVidMode->First->next;