From 96f549ab32120fe75d4a0ab7350daf4ab8f03718 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Thu, 15 Dec 2022 19:17:09 +0800 Subject: [PATCH] avoid bug for #2159 --- webrtc/WebRtcTransport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 7bf117ee..bbb3844a 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -360,7 +360,7 @@ void WebRtcTransport::sendRtcpPacket(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); onBeforeEncryptRtcp(pkt->data(), len, ctx); if (_srtp_session_send->EncryptRtcp(reinterpret_cast(pkt->data()), &len)) { pkt->setSize(len);