diff --git a/host/Capture/DXGI.cpp b/host/Capture/DXGI.cpp index 2cc44461..88c56aa9 100644 --- a/host/Capture/DXGI.cpp +++ b/host/Capture/DXGI.cpp @@ -401,8 +401,9 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame) frame.width = desc.Width; frame.height = desc.Height; frame.stride = rect.Pitch / 4; - - memcpySSE(frame.buffer, rect.pBits, min(frame.bufferSize, m_height * rect.Pitch)); + + unsigned int size = m_height * rect.Pitch; + memcpySSE(frame.buffer, rect.pBits, size < frame.bufferSize ? size : frame.bufferSize); status = surface->Unmap();