Increment pixel pointer for every *pixel*, not every *stride*.
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com
From: Jinoh Kang jinoh.kang.kr@gmail.com
Increment pixel pointer for every *pixel*, not every *stride*.
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- dlls/windowscodecs/imgfactory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/imgfactory.c b/dlls/windowscodecs/imgfactory.c index c7e101e3d62..7a2107098c0 100644 --- a/dlls/windowscodecs/imgfactory.c +++ b/dlls/windowscodecs/imgfactory.c @@ -902,9 +902,9 @@ static HRESULT WINAPI ImagingFactory_CreateBitmapFromHICON(IWICImagingFactory2 * { /* If any pixel has a non-zero alpha, ignore hbmMask */ bits = (DWORD *)buffer; - for (x = 0; x < width && !has_alpha; x++, bits++) + for (x = 0; x < width && !has_alpha; x++) { - for (y = 0; y < height; y++) + for (y = 0; y < height; y++, bits++) { if (*bits & 0xff000000) {
This didn't initially look right to me because the loop is written in a confusing way. We should always change x in the inner loop. I think it's probably correct but I'd like to see it cleaned up a bit more.
Since we don't actually care about the x and y coordinates, I would suggest a single loop over `width * height` pixels.