Commit 7ee553f4 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Fix the buffer size check in TIFF decoder's CopyPixels implementation.

parent 56eac4bd
......@@ -598,11 +598,9 @@ static void test_tiff_24bpp(void)
ok(hr == E_INVALIDARG, "CopyPixels(%u) should fail: %#x\n", stride, hr);
else
{
todo_wine_if(stride > 3)
ok(hr == S_OK, "CopyPixels(%u) error %#x\n", stride, hr);
for (i = 0; i < sizeof(data); i++)
todo_wine_if(stride > 3)
ok(data[i] == expected_data[i], "%u: expected %02x, got %02x\n", i, expected_data[i], data[i]);
}
}
......
......@@ -1105,7 +1105,7 @@ static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface,
if (cbStride < bytesperrow)
return E_INVALIDARG;
if ((cbStride * prc->Height) > cbBufferSize)
if ((cbStride * (prc->Height-1)) + bytesperrow > cbBufferSize)
return E_INVALIDARG;
min_tile_x = prc->X / This->decode_info.tile_width;
......
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