diff --git a/modules/desktop_capture/win/wgc_capture_session.cc b/modules/desktop_capture/win/wgc_capture_session.cc index 64247d2739..f439e21068 100644 --- a/modules/desktop_capture/win/wgc_capture_session.cc +++ b/modules/desktop_capture/win/wgc_capture_session.cc @@ -430,8 +430,12 @@ HRESULT WgcCaptureSession::ProcessFrame() { // Make a copy of the data pointed to by `map_info.pData` to the preallocated // `current_frame` so we are free to unmap our texture. uint8_t* src_data = static_cast(map_info.pData); - current_frame->CopyPixelsFrom(src_data, current_frame->stride(), - DesktopRect::MakeSize(current_frame->size())); + uint8_t* dst_data = current_frame->data(); + for (int i = 0; i < image_height; i++) { + memcpy(dst_data, src_data, current_frame->stride()); + dst_data += current_frame->stride(); + src_data += map_info.RowPitch; + } d3d_context->Unmap(mapped_texture_.Get(), 0);