In dlls/ddraw/ddraw/x11.c, the create_ximage function, we have
int bpp = PFGET_BPP(This->d.directdraw_pixelformat);
and this value is subsequently multiplied with the width and height values
in order to create an XImage. But this XImage is the destination of any
depth-conversion, so if there's depth-conversion, the bpp should be the
display's bpp, not the DirectDrawSurface's bpp... so I get crashes when I
run depth-conversion in plain Xlib mode (without XShm).
(The XShm version doesn't crash because in that case, the memory is
allocated by X, not by Wine...)
Unfortunately, I haven't convinced myself that I really know enough about
X to know the very best way to acquire the *real* display bpp value from
that routine... so if someone else could look at it?