[PATCH] Fix Xephyr segfault with 8 or 16-bit color depth

Michele Baldessari michele at acksyn.org
Sun Sep 15 03:09:50 PDT 2013


  Fix for https://bugs.freedesktop.org/show_bug.cgi?id=69357

Commit bd58ebe4cf3b0ce60f87fb26a3715f774dabd349 (ephyr: Fix crash on
24bpp host framebuffer) assumed that Xephyr's depth was always the same
as the host. Revert to previous behaviour but only when
host_depth does not match server_depth. This makes
Xephyr with 8 or 16 depth work on a 24 or 32bpp host while keeping
the fix introduced via bd58ebe.

Signed-off-by: Michele Baldessari <michele at acksyn.org>
---
 hw/kdrive/ephyr/hostx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 5071289..90db002 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -697,9 +697,10 @@ hostx_screen_init(EphyrScreenInfo screen,
             malloc(host_screen->ximg->bytes_per_line * buffer_height);
     }
 
-    *bytes_per_line = host_screen->ximg->bytes_per_line;
-    *bits_per_pixel = host_screen->ximg->bits_per_pixel;
-
+    if (host_depth_matches_server(host_screen)) {
+        *bytes_per_line = host_screen->ximg->bytes_per_line;
+        *bits_per_pixel = host_screen->ximg->bits_per_pixel;
+    }
     XResizeWindow(HostX.dpy, host_screen->win, width, height);
 
     /* Ask the WM to keep our size static */
-- 
1.8.3.1



More information about the xorg-devel mailing list