[Bug 3608] New: [PATCH] Fix for monochrome DIBs

Wine Bugs wine-bugs at winehq.org
Mon Oct 17 02:35:46 CDT 2005


           Summary: [PATCH] Fix for monochrome DIBs
           Product: Wine
           Version: CVS
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: wine-x11driver
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: oldium.pro at seznam.cz

I found a problem in translating XImage into DIB created by CreateDIBSection. I
also created a patch, which will be part of this bug-report. 

Affected applications: Neighbours from Hell (game).

All problems are in graphics/x11drv/dib.c only. It is only the case, when 
colors of DIB are inverted - so color[0]=0xFFFFFF and color[1]=0x000000 (and

In this patch:

1. When update XImage->DIB (monochrome images) is made, function
X11DRV_DIB_GetImageBits_1 falls back into "notsupported" branch. The palette of
the DIB was ignored in this case. If the colors are inverted, also image is
inverted for updating DIB. Update DIB->XImage is not affected as it uses the

2. Used XImage (bmpImage parameter) has RGB mask corresponding to current visual
(set by X during the creation of XImage), so it is not zero. The RGB mask was
checked for zero when copying BMP->DIB, so new static inline function
X11DRV_DIB_CheckMask was introduced.

3. Parameter colorMap was set to identity color map for every monochrome bitmap.
Changed to check if colorMap is NULL (should not be) or has the same colors
(color[0]==color[1], this can happen).

Note: This was sent to wine-patches mailing list (8th October 2005) but as I
don't know how fast is the reaction there, I rather created this issue for
tracking the problem.

Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the wine-bugs mailing list