mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-22 19:34:10 +00:00
windowscodecs: Fix non-zero alpha detection in ImagingFactory_CreateBitmapFromHICON.
Increment pixel pointer for every *pixel*, not every *stride*. Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
This commit is contained in:
parent
29dd844439
commit
e6155827e8
|
@ -901,16 +901,14 @@ static HRESULT WINAPI ImagingFactory_CreateBitmapFromHICON(IWICImagingFactory2 *
|
||||||
if (bm.bmBitsPixel == 32)
|
if (bm.bmBitsPixel == 32)
|
||||||
{
|
{
|
||||||
/* If any pixel has a non-zero alpha, ignore hbmMask */
|
/* If any pixel has a non-zero alpha, ignore hbmMask */
|
||||||
bits = (DWORD *)buffer;
|
DWORD *ptr = (DWORD *)buffer;
|
||||||
for (x = 0; x < width && !has_alpha; x++, bits++)
|
DWORD *end = ptr + width * height;
|
||||||
|
while (ptr != end)
|
||||||
{
|
{
|
||||||
for (y = 0; y < height; y++)
|
if (*ptr++ & 0xff000000)
|
||||||
{
|
{
|
||||||
if (*bits & 0xff000000)
|
has_alpha = TRUE;
|
||||||
{
|
break;
|
||||||
has_alpha = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue