windowscodecs: Allow CopyPixels to succeed without padding from the last row.

This commit is contained in:
Vincent Povirk 2012-08-14 16:40:33 -05:00 committed by Alexandre Julliard
parent 1742012ff0
commit 32bfd81051
1 changed files with 1 additions and 1 deletions

View File

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