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:
sergeyu
2015-09-04 18:38:07 -07:00
committed by Commit bot
parent 3cc834ae86
commit d5ae6ae6b5

View File

@ -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());
}