From: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/windowscodecs/converter.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index 0801d583d96..3ec4f6ef473 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -840,9 +840,9 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe BYTE *srcdata; UINT srcstride, srcdatasize; const BYTE *srcrow; - const BYTE *srcpixel; + const WORD *srcpixel; BYTE *dstrow; - DWORD *dstpixel; + BYTE *dstpixel; srcstride = 8 * prc->Width; srcdatasize = srcstride * prc->Height; @@ -857,15 +857,15 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe srcrow = srcdata; dstrow = pbBuffer; for (y=0; y<prc->Height; y++) { - srcpixel=srcrow; - dstpixel=(DWORD*)dstrow; + srcpixel=(const WORD *)srcrow; + dstpixel=dstrow; for (x=0; x<prc->Width; x++) { - BYTE red, green, blue, alpha; - srcpixel++; red = *srcpixel++; - srcpixel++; green = *srcpixel++; - srcpixel++; blue = *srcpixel++; - srcpixel++; alpha = *srcpixel++; - *dstpixel++=alpha<<24|red<<16|green<<8|blue; + dstpixel[2] = (srcpixel[0] + 127) / 257; + dstpixel[1] = (srcpixel[1] + 127) / 257; + dstpixel[0] = (srcpixel[2] + 127) / 257; + dstpixel[3] = (srcpixel[3] + 127) / 257; + srcpixel += 4; + dstpixel += 4; } srcrow += srcstride; dstrow += cbStride; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9803