summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-05-04 10:26:25 -0700
committerAaron Plattner <aplattner@nvidia.com>2008-05-04 10:26:25 -0700
commitd500eeb9458336780d77baf8b7db96e1f7ff4f0d (patch)
tree5b826d472603ef0327cbd0612af29d0da8f759ad
parentf4a68f3701889950d3b98842d021f357f3913fea (diff)
Xephyr: Handle depth 30 and reject higher depths rather than crashing.
-rw-r--r--hw/kdrive/ephyr/ephyr.c13
1 files changed, 12 insertions, 1 deletions
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);