# HG changeset patch # User Dan Minor # Date 1523557919 25200 # Node ID 1cece7d5df170946f822705ac7b28e2e57c0fd00 # Parent 1e957265b135852976cd1810c23e1262ba11019e Bug 1453740 - Allow 1x1 windows in VP8EncoderImpl::InitEncode; r=pehrsons A minimized window has a resolution of 1x1. Although we removed minimized windows from the list of available windows to share, nothing prevents the user from minimizing it during a call. With the current code, this will cause InitEncode to fail, resulting in a fatal release assert. I tested this patch with window sharing on meet.google.com and I was able to minimize and restore the window several times without problem. While minimized, the window appears as a black screen to the other meeting participants. It renders normally when restored. MozReview-Commit-ID: LE2NBiEy8nw diff --git a/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc --- a/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc +++ b/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc @@ -295,17 +295,17 @@ int VP8EncoderImpl::InitEncode(const Vid } if (inst->maxFramerate < 1) { return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; } // allow zero to represent an unspecified maxBitRate if (inst->maxBitrate > 0 && inst->startBitrate > inst->maxBitrate) { return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; } - if (inst->width <= 1 || inst->height <= 1) { + if (inst->width < 1 || inst->height < 1) { return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; } if (number_of_cores < 1) { return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; } if (inst->VP8().feedbackModeOn && inst->numberOfSimulcastStreams > 1) { return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; }