Commit a3fae9bc authored by Lambros Lambrou's avatar Lambros Lambrou Committed by Commit Bot

[remoting] Guard against null |frame| in OnFrameEncoded().

WebrtcVideoStream::OnFrameEncoded() expects that the |frame| parameter
might be null, but it tries to use it anyway. This CL adds a
null check before the dereference, preventing a host process crash.

Bug: 1049804
Change-Id: I3e02b7c5bced24611f2ba6a22025ff7ba173bd69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042138
Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Auto-Submit: Lambros Lambrou <lambroslambrou@chromium.org>
Reviewed-by: default avatarJamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739209}
parent e44ee075
...@@ -268,7 +268,9 @@ void WebrtcVideoStream::OnFrameEncoded( ...@@ -268,7 +268,9 @@ void WebrtcVideoStream::OnFrameEncoded(
// frame. // frame.
// TODO(crbug.com/891571): Remove |quantizer| from the WebrtcVideoEncoder // TODO(crbug.com/891571): Remove |quantizer| from the WebrtcVideoEncoder
// interface, and move this logic to the encoders. // interface, and move this logic to the encoders.
current_frame_stats_->frame_quality = (63 - frame->quantizer) * 100 / 63; if (frame) {
current_frame_stats_->frame_quality = (63 - frame->quantizer) * 100 / 63;
}
HostFrameStats stats; HostFrameStats stats;
scheduler_->OnFrameEncoded(frame.get(), &stats); scheduler_->OnFrameEncoded(frame.get(), &stats);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment