[PATCH 3/3] windowscodecs: Simplify the buffer size check in copy_pixels() helper.

Dmitry Timoshkov dmitry at baikal.ru
Wed Jan 9 00:51:18 CST 2019


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 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 7650c755ba..78281519b8 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 */
-- 
2.20.1




More information about the wine-devel mailing list