Commit e6155827 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

windowscodecs: Fix non-zero alpha detection in ImagingFactory_CreateBitmapFromHICON.

Increment pixel pointer for every *pixel*, not every *stride*. Signed-off-by: 's avatarJinoh Kang <jinoh.kang.kr@gmail.com>
parent 29dd8444
......@@ -901,12 +901,11 @@ static HRESULT WINAPI ImagingFactory_CreateBitmapFromHICON(IWICImagingFactory2 *
if (bm.bmBitsPixel == 32)
{
/* If any pixel has a non-zero alpha, ignore hbmMask */
bits = (DWORD *)buffer;
for (x = 0; x < width && !has_alpha; x++, bits++)
DWORD *ptr = (DWORD *)buffer;
DWORD *end = ptr + width * height;
while (ptr != end)
{
for (y = 0; y < height; y++)
{
if (*bits & 0xff000000)
if (*ptr++ & 0xff000000)
{
has_alpha = TRUE;
break;
......@@ -914,7 +913,6 @@ static HRESULT WINAPI ImagingFactory_CreateBitmapFromHICON(IWICImagingFactory2 *
}
}
}
}
else
GetDIBits(hdc, info.hbmMask, 0, height, buffer, &bi, DIB_RGB_COLORS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment