diff --git a/webrtc/modules/desktop_capture/screen_capturer_win.cc b/webrtc/modules/desktop_capture/screen_capturer_win.cc index 42a71922e..a9bcd48f9 100644 --- a/webrtc/modules/desktop_capture/screen_capturer_win.cc +++ b/webrtc/modules/desktop_capture/screen_capturer_win.cc @@ -337,10 +337,13 @@ void ScreenCapturerWin::CaptureCursor() { scoped_ptr cursor(new MouseCursorShape); cursor->hotspot = cursor_image->hotspot(); cursor->size = cursor_image->image().size(); - cursor->data.assign( - cursor_image->image().data(), - cursor_image->image().data() + - cursor_image->image().stride() * DesktopFrame::kBytesPerPixel); + uint8_t* current_row = cursor_image->image().data(); + for (int y = 0; y < cursor_image->image().size().height(); ++y) { + cursor->data.append(current_row, + current_row + cursor_image->image().size().width() * + DesktopFrame::kBytesPerPixel); + current_row += cursor_image->image().stride(); + } // Compare the current cursor with the last one we sent to the client. If // they're the same, then don't bother sending the cursor again.