Commit 3887c04f authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Simplify the buffer size check in copy_pixels() helper.

parent db8f5998
......@@ -82,7 +82,7 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
if (dststride < bytesperrow)
return E_INVALIDARG;
if ((dststride * (rc->Height-1)) + ((rc->Width * bpp) + 7)/8 > dstbuffersize)
if ((dststride * (rc->Height-1)) + bytesperrow > dstbuffersize)
return E_INVALIDARG;
/* if the whole bitmap is copied and the buffer format matches then it's a matter of a single memcpy */
......
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