Vincent Povirk : windowscodecs: Allow CopyPixels to succeed without padding from the last row.
Alexandre Julliard
julliard at winehq.org
Mon Aug 20 14:16:20 CDT 2012
Module: wine
Branch: master
Commit: 32bfd81051238bf50dbfd2b95cf811c8eeb35b69
URL: http://source.winehq.org/git/wine.git/?a=commit;h=32bfd81051238bf50dbfd2b95cf811c8eeb35b69
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Tue Aug 14 16:40:33 2012 -0500
windowscodecs: Allow CopyPixels to succeed without padding from the last row.
---
dlls/windowscodecs/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c
index 091b9fb..2898d97 100644
--- a/dlls/windowscodecs/main.c
+++ b/dlls/windowscodecs/main.c
@@ -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 */
More information about the wine-cvs
mailing list