[1/2] windowscodecs: Allow CopyPixels to succeed without padding from the last row.
Vincent Povirk
madewokherd at gmail.com
Mon Aug 20 10:52:00 CDT 2012
-------------- next part --------------
From 332d0d12a3f33f912cd0ccbf3e936c3f895343d5 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Tue, 14 Aug 2012 16:40:33 -0500
Subject: [PATCH 1/2] windowscodecs: Allow CopyPixels to succeed without
padding from the last row.
---
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 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 */
--
1.7.9.5
More information about the wine-patches
mailing list