From 1d84bb54585e986015986cb4702c65c7a166fecc Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Mon, 26 Apr 2021 21:50:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84twcc=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtcp/RtcpFCI.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Rtcp/RtcpFCI.cpp b/src/Rtcp/RtcpFCI.cpp index e9627abc..dc48be52 100644 --- a/src/Rtcp/RtcpFCI.cpp +++ b/src/Rtcp/RtcpFCI.cpp @@ -423,22 +423,26 @@ map > FCI_TWCC::getPacketCh auto end = (uint8_t *) this + total_size; CHECK(ptr < end); auto seq = getBaseSeq(); - - for (uint8_t i = 0; i < getPacketCount();) { + auto rtp_count = getPacketCount(); + for (uint8_t i = 0; i < rtp_count;) { CHECK(ptr + RunLengthChunk::kSize <= end); RunLengthChunk *chunk = (RunLengthChunk *) ptr; if (!chunk->type) { //RunLengthChunk for (auto j = 0; j < chunk->getRunLength(); ++j) { ret.emplace(seq++, std::make_pair((SymbolStatus) chunk->symbol, 0)); - ++i; + if (++i >= rtp_count) { + break; + } } } else { //StatusVecChunk StatusVecChunk *chunk = (StatusVecChunk *) ptr; for (auto &symbol : chunk->getSymbolList()) { ret.emplace(seq++, std::make_pair(symbol, 0)); - ++i; + if (++i >= rtp_count) { + break; + } } } ptr += 2;