From 63b97de330fe3d4775b9b4df8ad15c7593d58fc0 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Tue, 14 Dec 2021 02:43:32 +0100 Subject: [PATCH] Fix use-after-move in VideoReceiveStream2 Fix multiple use-after-move issues in VideoReceiveStream2, as found by clang-tidy: video/video_receive_stream2.cc:259: 'config' used after it was moved video/video_receive_stream2.cc:199: move occurred here Bug: chromium:1122844 Change-Id: I6367dc835f002718a5353c3e0b64c2a154e79925 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/241201 Auto-Submit: Maksim Ivanov Reviewed-by: Tomas Gunnarsson Commit-Queue: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#35530} --- video/video_receive_stream2.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 528b2998e9..045374d358 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -222,8 +222,8 @@ VideoReceiveStream2::VideoReceiveStream2( std::move(config_.frame_decryptor), std::move(config_.frame_transformer)), rtp_stream_sync_(call->worker_thread(), this), - max_wait_for_keyframe_ms_(DetermineMaxWaitForFrame(config, true)), - max_wait_for_frame_ms_(DetermineMaxWaitForFrame(config, false)), + max_wait_for_keyframe_ms_(DetermineMaxWaitForFrame(config_, true)), + max_wait_for_frame_ms_(DetermineMaxWaitForFrame(config_, false)), low_latency_renderer_enabled_("enabled", true), low_latency_renderer_include_predecode_buffer_("include_predecode_buffer", true), @@ -256,10 +256,10 @@ VideoReceiveStream2::VideoReceiveStream2( if (config_.rtp.rtx_ssrc) { rtx_receive_stream_ = std::make_unique( - &rtp_video_stream_receiver_, config.rtp.rtx_associated_payload_types, + &rtp_video_stream_receiver_, config_.rtp.rtx_associated_payload_types, config_.rtp.remote_ssrc, rtp_receive_statistics_.get()); } else { - rtp_receive_statistics_->EnableRetransmitDetection(config.rtp.remote_ssrc, + rtp_receive_statistics_->EnableRetransmitDetection(config_.rtp.remote_ssrc, true); }