From d500eeb9458336780d77baf8b7db96e1f7ff4f0d Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Sun, 4 May 2008 10:26:25 -0700 Subject: [PATCH] Xephyr: Handle depth 30 and reject higher depths rather than crashing. --- hw/kdrive/ephyr/ephyr.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index d69e1489b..3989d0d9f 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -150,11 +150,22 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv) screen->fb[0].depth = 16; screen->fb[0].bitsPerPixel = 16; } - else + else if (screen->fb[0].depth <= 24) { screen->fb[0].depth = 24; screen->fb[0].bitsPerPixel = 32; } + else if (screen->fb[0].depth <= 30) + { + screen->fb[0].depth = 30; + screen->fb[0].bitsPerPixel = 32; + } + else + { + ErrorF("\nXephyr: Unsupported screen depth %d\n", + screen->fb[0].depth); + return FALSE; + } hostx_get_visual_masks (screen, &redMask, &greenMask, &blueMask);