diff --git a/webrtc/modules/desktop_capture/screen_capturer_x11.cc b/webrtc/modules/desktop_capture/screen_capturer_x11.cc index b4f3bf575b8..ed317740708 100644 --- a/webrtc/modules/desktop_capture/screen_capturer_x11.cc +++ b/webrtc/modules/desktop_capture/screen_capturer_x11.cc @@ -340,7 +340,8 @@ std::unique_ptr ScreenCapturerLinux::CaptureScreen() { // Doing full-screen polling, or this is the first capture after a // screen-resolution change. In either case, need a full-screen capture. DesktopRect screen_rect = DesktopRect::MakeSize(frame->size()); - x_server_pixel_buffer_.CaptureRect(screen_rect, frame.get()); + if (!x_server_pixel_buffer_.CaptureRect(screen_rect, frame.get())) + return nullptr; updated_region->SetRect(screen_rect); }