summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0084.patch
blob: 8a565cc5d31f22095aafcb577a45f95fdeb122f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Byron Campen <docfaraday@gmail.com>
Date: Thu, 20 Jul 2023 14:24:00 +0000
Subject: Bug 1838080: Work around a race in
 ChannelSendFrameTransformerDelegate. r=pehrsons,webrtc-reviewers

This variable can be null when a ChannelSendFrameTransformerDelegate is in use,
because that does an async dispatch to the encoder queue in the handling for
transformed frames. If this is unset while that dispatch is in flight, we
nullptr crash.

Differential Revision: https://phabricator.services.mozilla.com/D180735
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56555ecee7f36ae73abff1cbbd06807c2b65fc19
---
 audio/channel_send.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/audio/channel_send.cc b/audio/channel_send.cc
index 61e68d19df..3c59be52b4 100644
--- a/audio/channel_send.cc
+++ b/audio/channel_send.cc
@@ -286,12 +286,16 @@ class RtpPacketSenderProxy : public RtpPacketSender {
   void EnqueuePackets(
       std::vector<std::unique_ptr<RtpPacketToSend>> packets) override {
     MutexLock lock(&mutex_);
-    rtp_packet_pacer_->EnqueuePackets(std::move(packets));
+    if (rtp_packet_pacer_) {
+      rtp_packet_pacer_->EnqueuePackets(std::move(packets));
+    }
   }
 
   void RemovePacketsForSsrc(uint32_t ssrc) override {
     MutexLock lock(&mutex_);
-    rtp_packet_pacer_->RemovePacketsForSsrc(ssrc);
+    if (rtp_packet_pacer_) {
+      rtp_packet_pacer_->RemovePacketsForSsrc(ssrc);
+    }
   }
 
  private: