From 8a9f04e2726a38157dbb2b70c33fb07bbb44eb7f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 24 Jan 2011 11:17:03 +0000 Subject: [PATCH] VidMode: prevent crash with no modes Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=14731 Signed-off-by: Chris Wilson --- hw/xfree86/common/xf86VidMode.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index 1788fa1..c22243a 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; -- 1.7.2.3