diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc index 254b7d610a..45ea4669ea 100644 --- a/webrtc/video/video_send_stream.cc +++ b/webrtc/video/video_send_stream.cc @@ -177,8 +177,8 @@ VideoSendStream::VideoSendStream( vie_capturer_ = new ViECapturer(module_process_thread_, vie_encoder_); // 28 to match packet overhead in ModuleRtpRtcpImpl. - vie_channel_->SetMTU( - static_cast(config_.rtp.max_packet_size + 28)); + DCHECK_LE(config_.rtp.max_packet_size, static_cast(0xFFFF - 28)); + vie_channel_->SetMTU(static_cast(config_.rtp.max_packet_size + 28)); DCHECK(config.encoder_settings.encoder != nullptr); DCHECK_GE(config.encoder_settings.payload_type, 0);