diff --git a/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm b/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm index 0da9869242..46d2a8d1ee 100644 --- a/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm +++ b/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm @@ -158,8 +158,8 @@ void MouseCursorMonitorMac::CaptureImage() { DesktopSize size(nssize.width, nssize.height); NSPoint nshotspot = [nscursor hotSpot]; DesktopVector hotspot( - std::min(0, std::max(size.width(), static_cast(nshotspot.x))), - std::min(0, std::max(size.height(), static_cast(nshotspot.y)))); + std::max(0, std::min(size.width(), static_cast(nshotspot.x))), + std::max(0, std::min(size.height(), static_cast(nshotspot.y)))); CGImageRef cg_image = [nsimage CGImageForProposedRect:NULL context:nil hints:nil]; if (!cg_image)