Fix ScreenCapturerWinGdi to handle DesktopFrameWin::Create() errors.
DesktopFrameWin::Create() may return nullptr when it fails to allocate windows bitmap. ScreenCapturerWinGdi wasn't handling that case properly. BUG=527660 Review URL: https://codereview.webrtc.org/1309143007 Cr-Commit-Position: refs/heads/master@{#9865}
This commit is contained in:
@ -241,9 +241,10 @@ bool ScreenCapturerWinGdi::CaptureImage() {
|
||||
DesktopFrame::kBytesPerPixel;
|
||||
SharedMemory* shared_memory = callback_->CreateSharedMemory(buffer_size);
|
||||
|
||||
rtc::scoped_ptr<DesktopFrame> buffer;
|
||||
buffer.reset(
|
||||
rtc::scoped_ptr<DesktopFrame> buffer(
|
||||
DesktopFrameWin::Create(size, shared_memory, desktop_dc_));
|
||||
if (!buffer.get())
|
||||
return false;
|
||||
queue_.ReplaceCurrentFrame(buffer.release());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user