RESEND: CreateDIBitmap: Don't create monochrome bitmaps

Dmitry Timoshkov dmitry at baikal.ru
Mon Sep 6 20:07:40 CDT 2004


"Huw D M Davies" <h.davies1 at physics.ox.ac.uk> wrote:

> +        /* Need to check if the bitmap is monochrome, and if the
> +           two colors are really black and white */
> +        if (is_dib_monochrome(pbi))
> +        {
> +          /* Top-down DIBs have a negative height */
> +          DWORD height = pbi->bmiHeader.biHeight;
> +          if (height < 0) height = -height;

[skipped]

> +            /* If it's possible, create a monochrome bitmap */
> +
> +            DWORD height = fix_info->bmiHeader.biHeight;
> +            if (height < 0) height = -height;

In the code above 'DWORD height' should be changed to 'LONG height'
otherwise the test 'height < 0' will always fail.

-- 
Dmitry.




More information about the wine-devel mailing list