"make test" failure in gdi32/bitmap.c

Francois Gouget fgouget at free.fr
Wed Oct 17 02:43:09 CDT 2007


On Tue, 16 Oct 2007, Dan Kegel wrote:

> "make test" fails for me with:
> 
> bitmap.c:1113: Test failed: GetDIBits with 4 bpp DIB selected in DC:
> Invalid DIB bits
> bitmap.c:1113: Test failed: GetDIBits with 8 bpp DIB selected in DC:
> Invalid DIB bits

I'm working on the above two. From my testing they only happen when X 
is in 16bpp mode (and probably 15bpp too). If I switch to 24bpp then all 
is fine. The reason is that dlls/winex11.drv/dib.c uses two types of 
color maps:
 * the first one contains RGBQUADs so in it white is (0xff, 0xff, 0xff, 
0)
 * the second one maps an index to the corresponding X color (an int). 
So in 15bpp white would be 0x7fff.

The bug happens because the code casts the int* color map to the 
RGBQUAD* color map in many places so that it interprets 0x7fff as an 
RGBQUAD and thus returns the wrong color index.


> err:x11drv:X11DRV_CreateBitmap Trying to make bitmap with planes=1, bpp=24
> err:bitmap:DIB_GetBitmapInfo (39): unknown/wrong size for header
> err:bitmap:DIB_GetBitmapInfo (11): unknown/wrong size for header
> err:bitmap:DIB_GetBitmapInfo (13): unknown/wrong size for header
> err:bitmap:DIB_GetBitmapInfo (16): unknown/wrong size for header

I don't know anything about these however.

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
          tcA thgirypoC muinelliM latigiD eht detaloiv tsuj evah uoY



More information about the wine-devel mailing list