From eeb21a133b982f71de739baf62e53c8a68f5d495 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 24 Jan 2011 11:17:03 +0000 Subject: VidMode: prevent crash with no modes Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=17431 Signed-off-by: Chris Wilson Reviewed-by: Jeremy Huddleston --- hw/xfree86/common/xf86VidMode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index 4dd454d8b..2ae5484e3 100644 --- a/hw/xfree86/common/xf86VidMode.c +++ b/hw/xfree86/common/xf86VidMode.c @@ -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; -- cgit v1.2.3