[PATCH 0/1] MR5568: windowscodecs: Avoid implicit cast changing value.
This appear to be introduced with commit 12f73ed9d851. When This->stride is negative (bottom up image) it converts the multiplication to an UINT. Thus causing the pointer to be incorrect when y > 0. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5568
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> This appear to be introduced with commit 12f73ed9d851. When This->stride is negative (bottom up image) it converts the multiplication to an UINT. Thus causing the pointer to be incorrect when y > 0. --- dlls/windowscodecs/bmpdecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c index 9d4867447f0..ae6feda5b50 100644 --- a/dlls/windowscodecs/bmpdecode.c +++ b/dlls/windowscodecs/bmpdecode.c @@ -432,7 +432,7 @@ static HRESULT BmpFrameDecode_ReadABGRasBGR(BmpDecoder* This) { for (y = 0; y < height; y++) { - pixel = This->imagedatastart + This->stride * y; + pixel = This->imagedatastart + This->stride * (INT)y; for (x = 0; x < width; x++) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5568
The code was copied from `reverse_bgr8` helper so it has similar problem. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5568#note_69398
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Piotr Caban (@piotr)