Invalidate the whole screen when the frame size is changed.

Otherwise we'll compare frames of different sizes and read into invalid
memory.

BUG=https://code.google.com/p/chromium/issues/detail?id=345498
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/9149004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5614 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
jiayl@webrtc.org 2014-02-26 18:54:57 +00:00
parent 2038920a2b
commit 0231e801d6

View File

@ -169,7 +169,7 @@ void ScreenCapturerWin::Capture(const DesktopRegion& region) {
const DesktopFrame* current_frame = queue_.current_frame();
const DesktopFrame* last_frame = queue_.previous_frame();
if (last_frame) {
if (last_frame && last_frame->size().equals(current_frame->size())) {
// Make sure the differencer is set up correctly for these previous and
// current screens.
if (!differ_.get() ||
@ -188,7 +188,8 @@ void ScreenCapturerWin::Capture(const DesktopRegion& region) {
&region);
helper_.InvalidateRegion(region);
} else {
// No previous frame is available. Invalidate the whole screen.
// No previous frame is available, or the screen is resized. Invalidate the
// whole screen.
helper_.InvalidateScreen(current_frame->size());
}