diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-24 11:17:03 +0000 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-11-18 11:26:02 -0800 |
commit | eeb21a133b982f71de739baf62e53c8a68f5d495 (patch) | |
tree | c6ba8807758d6017a7e728de23a6c8fb9a1e0240 | |
parent | c1bb8f43b9290c2b18a9f0ac59773ff8f1eb974f (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>
-rw-r--r-- | 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 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; |