From f12e6877945e8c224ce143983a74697a03fbfeb9 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel <lkundrak@v3.sk> Date: Mon, 10 May 2010 09:25:55 +0200 Subject: [PATCH] Handle startup without monitor attached more gracefully Refuse to configure a screen which has no valid modes. Otherwise X server would crash attempting to dereference to modes list later on. --- src/nv_driver.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/nv_driver.c b/src/nv_driver.c index 795859f..aed24f7 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -794,6 +794,10 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) pScrn->depth); } + /* No usable mode */ + if (!pScrn->modes) + return FALSE; + /* Set the current mode to the first in the list */ pScrn->currentMode = pScrn->modes; -- 1.6.5.2