Commit 013f54af authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

windowscodecs: Avoid implicit cast changing value.

This appear to be introduced with commit 12f73ed9. 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.
parent 4ae893e2
...@@ -432,7 +432,7 @@ static HRESULT BmpFrameDecode_ReadABGRasBGR(BmpDecoder* This) ...@@ -432,7 +432,7 @@ static HRESULT BmpFrameDecode_ReadABGRasBGR(BmpDecoder* This)
{ {
for (y = 0; y < height; y++) 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++) for (x = 0; x < width; x++)
{ {
......
...@@ -201,7 +201,7 @@ void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT ...@@ -201,7 +201,7 @@ void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT
for (y=0; y<height; y++) for (y=0; y<height; y++)
{ {
pixel = bits + stride * y; pixel = bits + stride * (INT)y;
for (x=0; x<width; x++) for (x=0; x<width; x++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment