[PATCH] quartz: Don't write past end of d3d9 buffer

Andrew Eikum aeikum at codeweavers.com
Mon Jan 9 10:46:01 CST 2017


Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
---
 dlls/quartz/vmr9.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 3c8393fc7a..490d8d8e77 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -260,9 +260,9 @@ static DWORD VMR9_SendSampleData(struct quartz_vmr *This, VMR9PresentationInfo *
         lock.pBits = (char *)lock.pBits + (height * lock.Pitch);
         while (height--)
         {
-            memcpy(lock.pBits, data, width * bmiHeader->biBitCount / 8);
-            data = data + width * bmiHeader->biBitCount / 8;
             lock.pBits = (char *)lock.pBits - lock.Pitch;
+            memcpy(lock.pBits, data, width * bmiHeader->biBitCount / 8);
+            data = data + width * bmiHeader->biBitCount / 8;
         }
     }
     else if (lock.Pitch != width * bmiHeader->biBitCount / 8)
-- 
2.11.0




More information about the wine-patches mailing list