From eef09fc42d983d480b6c6d5a6a97893c92863e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Fri, 16 Mar 2018 10:47:16 +0100 Subject: [PATCH] Fix race in DegradedCall::DestroyVideoSendStream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VideoSendStream might call SendRtp or SendRtcp asynchronously (for instance periodic RTCP messages), so we must destroy the VideoSendStream before FakeNetworkPipe, otherwise might crash in DegradedCall::SendRtcp. Bug: webrtc:8910 Change-Id: I18e76c40a5213bd7378a39acba100edd9e2a193b Reviewed-on: https://webrtc-review.googlesource.com/62341 Commit-Queue: Erik Språng Reviewed-by: Niels Moller Cr-Commit-Position: refs/heads/master@{#22468} --- call/degraded_call.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/degraded_call.cc b/call/degraded_call.cc index 356147fd8b..6515b65b9e 100644 --- a/call/degraded_call.cc +++ b/call/degraded_call.cc @@ -94,6 +94,7 @@ VideoSendStream* DegradedCall::CreateVideoSendStream( } void DegradedCall::DestroyVideoSendStream(VideoSendStream* send_stream) { + call_->DestroyVideoSendStream(send_stream); if (send_pipe_ && num_send_streams_ > 0) { --num_send_streams_; if (num_send_streams_ == 0) { @@ -101,7 +102,6 @@ void DegradedCall::DestroyVideoSendStream(VideoSendStream* send_stream) { send_pipe_.reset(); } } - call_->DestroyVideoSendStream(send_stream); } VideoReceiveStream* DegradedCall::CreateVideoReceiveStream(