From c0b67e7cb2f6648a89199ffbf32aabdcb0751aa4 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 14 Dec 2017 20:34:32 +1100 Subject: [PATCH] [host] DXGI: copy based on the actual pitch --- host/Capture/DXGI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/host/Capture/DXGI.cpp b/host/Capture/DXGI.cpp index 07ded009..9956b1a0 100644 --- a/host/Capture/DXGI.cpp +++ b/host/Capture/DXGI.cpp @@ -397,13 +397,13 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame) m_width = desc.Width; m_height = desc.Height; - const int pitch = m_width * 4; frame.width = desc.Width; frame.height = desc.Height; - frame.stride = desc.Width; + frame.stride = rect.Pitch / 4; + + memcpySSE(frame.buffer, rect.pBits, min(frame.bufferSize, m_height * rect.Pitch)); - memcpySSE(frame.buffer, rect.pBits, min(frame.bufferSize, m_height * pitch)); status = surface->Unmap(); if (FAILED(status))