From d6fee6bf0b48c91fd878e70250e049155fa0effa Mon Sep 17 00:00:00 2001 From: arcnmx Date: Thu, 14 Dec 2017 14:15:03 -0500 Subject: [PATCH] [host] inline the implementation of min() --- host/Capture/DXGI.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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();