Skip to content

Commit

Permalink
windowscodecs: Avoid implicit cast changing value.
Browse files Browse the repository at this point in the history
This appear to be introduced with commit 12f73ed.

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.
  • Loading branch information
alesliehughes authored and julliard committed May 2, 2024
1 parent 4ae893e commit 013f54a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dlls/windowscodecs/bmpdecode.c
Expand Up @@ -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++)
{
Expand Down
2 changes: 1 addition & 1 deletion dlls/windowscodecs/wincodecs_common.h
Expand Up @@ -201,7 +201,7 @@ void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT

for (y=0; y<height; y++)
{
pixel = bits + stride * y;
pixel = bits + stride * (INT)y;

for (x=0; x<width; x++)
{
Expand Down

0 comments on commit 013f54a

Please sign in to comment.