user32/gdi32: Fix for a crash in create_alpha_bitmap()

Peter Schlaile peter at
Sun Jan 30 13:02:01 CST 2011

Hi Vitaliy,

On Sun, 30 Jan 2011, Vitaliy Margolen wrote:

> On 01/30/2011 04:16 AM, Peter Schlaile wrote:
>> Hi,
>> find fix for a crash in create_alpha_bitmap() attached.
> If it's easy to reproduce please create a test that demonstrates the problem.

hmm, don't know, the application that triggered it, can be downloaded here:

It will fail on startup, because of that problem, showing a dialog box, 
that some of it's data has been damaged and offers you to close or restart. 
(The program installs it's own page fault exception handler, you can see 
the reason of the crash if you run wine with WINEDEBUG=+relay .)

If you apply my patch, it will start up correctly, ask for a valid license 
key (which can be skipped) and show a search screen for CDs/DVDs published 
in Germany.

Nevertheless: I hope, I explained pretty well, how and why the current 
code is wrong (aquiring a bitmap-pointer using CreateDIBSection, 
setting this bitmap to readonly using the fast track code path 
within StretchDIBits, writing to this bitmap again.).

>> Additional minor fix: bmi_has_alpha() tests for alpha channel != 0, but
>>  should test for alpha channel != 255.
> This should be a separate patch.

probably, but you will agree, that this is a rather trivial change... (and 
pretty obvious, too).

Hope that's ok anyways.


Peter Schlaile

More information about the wine-devel mailing list