From c1187ab34bdf836bd33f7f050d525184eba4cd20 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Mon, 29 Apr 2019 13:55:35 -0400 Subject: [PATCH] Partially revert https://webrtc-review.googlesource.com/c/src/+/110461. X11 returns the image data in a |long|, and CL [1] broke the captured on 32-bit builds. [1] - https://webrtc-review.googlesource.com/c/src/+/110461 Bug: chromium:954762 Change-Id: I2620e977ed0dd7ae355b9acd938cfcbeaaa9bfb3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134541 Commit-Queue: Mirko Bonadei Reviewed-by: Wez Reviewed-by: Sergey Ulanov Cr-Commit-Position: refs/heads/master@{#27807} --- modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc b/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc index 68323a0f86..772ec8b3d5 100644 --- a/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc +++ b/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc @@ -206,11 +206,12 @@ void MouseCursorMonitorX11::CaptureCursor() { std::unique_ptr image( new BasicDesktopFrame(DesktopSize(img->width, img->height))); - uint64_t* src = reinterpret_cast(img->pixels); + // Xlib stores 32-bit data in longs, even if longs are 64-bits long. + unsigned long* src = img->pixels; uint32_t* dst = reinterpret_cast(image->data()); uint32_t* dst_end = dst + (img->width * img->height); while (dst < dst_end) { - *dst++ = *src++; + *dst++ = static_cast(*src++); } DesktopVector hotspot(std::min(img->width, img->xhot),