[Bug 7477] Uplink demo crashes

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Dec 23 14:56:05 CST 2007


http://bugs.winehq.org/show_bug.cgi?id=7477


Andrey Turkin <andrey.turkin at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrey.turkin at gmail.com




--- Comment #10 from Andrey Turkin <andrey.turkin at gmail.com>  2007-12-23 14:56:04 ---
Anastasius is right about SDL. This crash can happen only if X runs in 16-bit
depth mode (so there are easy workaround). In SDL, root cause lies in
DIB_SussScreenDepth function; namely, this:
<snip>
    /* Convert the DDB to a DIB.  We need to call GetDIBits twice:
     * the first call just fills in the BITMAPINFOHEADER; the 
     * second fills in the bitfields or palette.
     */
    GetDIBits(hdc, hbm, 0, 1, NULL, (LPBITMAPINFO) dib_hdr, DIB_RGB_COLORS);
    GetDIBits(hdc, hbm, 0, 1, NULL, (LPBITMAPINFO) dib_hdr, DIB_RGB_COLORS); 
    DeleteObject(hbm);
    ReleaseDC(NULL, hdc);

    depth = 0;
    switch( dib_hdr->biBitCount )
    {
    case 8:     depth = 8; break;
    case 24:    depth = 24; break;
    case 32:    depth = 32; break;
    case 16:
        if( dib_hdr->biCompression == BI_BITFIELDS ) {
            /* check the red mask */
            switch( ((DWORD*)((char*)dib_hdr + dib_hdr->biSize))[0] ) {
                case 0xf800: depth = 16; break;   /* 565 */
                case 0x7c00: depth = 15; break;   /* 555 */
            }
        }
</snip>

Difference between Windows and Wine is in GetDIBits - in Windows second
GetDIBits invocation (with bit depth filled in) fills in color masks, while in
Wine it does not. I have no idea how to properly fix the function.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list