"Huw D M Davies" h.davies1@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.