[PATCH 3/5] mfplat: Always initialize output arguments in GetScanline0AndPitch() for d3d9 buffers.

Nikolay Sivov nsivov at codeweavers.com
Thu Mar 25 04:40:33 CDT 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/mfplat/buffer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c
index e6bf52662e8..d4efafdea45 100644
--- a/dlls/mfplat/buffer.c
+++ b/dlls/mfplat/buffer.c
@@ -689,7 +689,11 @@ static HRESULT WINAPI d3d9_surface_buffer_GetScanline0AndPitch(IMF2DBuffer2 *ifa
     EnterCriticalSection(&buffer->cs);
 
     if (!buffer->_2d.locks)
+    {
+        *scanline0 = NULL;
+        *pitch = 0;
         hr = HRESULT_FROM_WIN32(ERROR_WAS_UNLOCKED);
+    }
     else
     {
         *scanline0 = buffer->d3d9_surface.rect.pBits;
-- 
2.30.2




More information about the wine-devel mailing list