From f6a36180b4b59ad4e53e52879972705124b9f81a Mon Sep 17 00:00:00 2001 From: monktan89 Date: Wed, 14 Dec 2022 15:08:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwebrtc=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=86=85=E5=AD=98=E8=B6=8A=E7=95=8C=E7=9A=84?= =?UTF-8?q?bug:=20#2159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/WebRtcTransport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index ccaaaddb..7bf117ee 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -346,7 +346,7 @@ void WebRtcTransport::sendRtpPacket(const char *buf, int len, bool flush, void * auto pkt = _packet_pool.obtain2(); // 预留rtx加入的两个字节 pkt->setCapacity((size_t)len + SRTP_MAX_TRAILER_LEN + 2); - pkt->assign(buf, len); + memcpy(pkt->data(), buf, len); onBeforeEncryptRtp(pkt->data(), len, ctx); if (_srtp_session_send->EncryptRtp(reinterpret_cast(pkt->data()), &len)) { pkt->setSize(len);