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

Alexandre Julliard julliard at winehq.org
Thu Jan 10 13:27:09 CST 2019


Module: wine
Branch: master
Commit: 3887c04f4322a3611cb02be778f001ee59380deb
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3887c04f4322a3611cb02be778f001ee59380deb

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Jan  9 14:51:18 2019 +0800

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

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windowscodecs/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c
index 7650c75..7828151 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-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 */




More information about the wine-cvs mailing list