summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-24 11:17:03 +0000
committerJeremy Huddleston <jeremyhu@apple.com>2011-11-21 18:43:43 -0800
commit6105fcaa3592cb6d0d5f22d9b850986d0bc4d241 (patch)
tree2d3aa45b5d9c2c4537e713b0bb6547c52d3f8996
parentd113b2911573f3685dc644c6fdd1979aa880b99f (diff)
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> (cherry picked from commit eeb21a133b982f71de739baf62e53c8a68f5d495)
-rw-r--r--hw/xfree86/common/xf86VidMode.c3
1 files changed, 3 insertions, 0 deletions
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;