Fix for defect found by clusterfuzz.
Cause: VideoRtpReceiver::media_channel_ was used when it was null. Fix: only use when provably not null. Bug: chromium:1031013 Change-Id: I765e183186d895f39c122e26d50ac787216c44f7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161328 Commit-Queue: Markus Handell <handellm@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30017}
This commit is contained in:

committed by
Commit Bot

parent
755187f9c3
commit
fc9079700c
@ -155,6 +155,7 @@ void VideoRtpReceiver::RestartMediaChannel(absl::optional<uint32_t> ssrc) {
|
||||
}
|
||||
|
||||
void VideoRtpReceiver::SetSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
|
||||
RTC_DCHECK(media_channel_);
|
||||
if (ssrc_) {
|
||||
media_channel_->SetSink(*ssrc_, sink);
|
||||
return;
|
||||
@ -271,6 +272,11 @@ std::vector<RtpSource> VideoRtpReceiver::GetSources() const {
|
||||
|
||||
void VideoRtpReceiver::OnGenerateKeyFrame() {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
if (!media_channel_) {
|
||||
RTC_LOG(LS_ERROR)
|
||||
<< "VideoRtpReceiver::OnGenerateKeyFrame: No video channel exists.";
|
||||
return;
|
||||
}
|
||||
// TODO(bugs.webrtc.org/8694): Stop using 0 to mean unsignalled SSRC
|
||||
media_channel_->GenerateKeyFrame(ssrc_.value_or(0));
|
||||
// We need to remember to request generation of a new key frame if the media
|
||||
|
Reference in New Issue
Block a user