summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-10-28 09:37:52 +0100
committerAdam Jackson <ajax@redhat.com>2007-11-02 12:06:09 -0400
commit7a0555e9bb59d02816803a1100f807d2d29f31d4 (patch)
tree1efc077a8ebfc446cce3927d0d32568cd7c3a47c /hw/xfree86
parent5b41d4e60be35cfb96bedec0931fd5922823b4b9 (diff)
Fix crash in xf86InitOrigins()
In a multihead setup, if only the first screen can be initialized, but the second screen is mentioned first in the ServerLayout section, the xf86InitOrigins() function will crash because the screen referred to in the e.g. "RightOf" part is non-existent.
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/common/xf86Cursor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 9e6e62216..3ea1b4d91 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -558,6 +558,14 @@ xf86InitOrigins(void)
screen = &xf86ConfigLayout.screens[i];
+ if (screen->refscreen != NULL &&
+ screen->refscreen->screennum >= xf86NumScreens) {
+ screensLeft &= ~(1 << i);
+ xf86Msg(X_WARNING, "Not including screen \"%s\" in origins calculation.\n",
+ screen->screen->id);
+ continue;
+ }
+
switch(screen->where) {
case PosObsolete:
OldStyleConfig = TRUE;