From e839da02c1d321cb17bf8f9b28ecb186a37e1ee6 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Fri, 22 Nov 2013 20:39:16 +0000 Subject: [PATCH] Fix MouseCursor to MouseCursorShape conversion in ScreenCapturerWin. BUG=crbug.com/322596 R=dcaiafa@chromium.org, wez@chromium.org Review URL: https://webrtc-codereview.appspot.com/4279005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5165 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/desktop_capture/screen_capturer_win.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/desktop_capture/screen_capturer_win.cc b/webrtc/modules/desktop_capture/screen_capturer_win.cc index 42a71922e1..a9bcd48f9c 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.