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

--HG--
extra : rebase_source : f95fd3f797e9f7262a938087ce3fb1e27f743920
This commit is contained in:
Dan Minor 2018-04-12 11:31:59 -07:00
parent 41efc0826a
commit b42c863551

View File

@ -300,7 +300,7 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst,
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) {