From 052d479004e27f47019b1da6bd350dac3168016d Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 1 Dec 2023 17:00:49 +0800 Subject: [PATCH] Fix crash caused by invalid iterator access --- src/rtp/rtp_video_receiver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rtp/rtp_video_receiver.cpp b/src/rtp/rtp_video_receiver.cpp index f115804..c74f0bf 100644 --- a/src/rtp/rtp_video_receiver.cpp +++ b/src/rtp/rtp_video_receiver.cpp @@ -173,15 +173,16 @@ bool RtpVideoReceiver::CheckIsFrameCompleted(RtpPacket& rtp_packet) { while (end_seq--) { auto it = incomplete_frame_list_.find(end_seq); - complete_frame_size += it->second.PayloadSize(); if (it == incomplete_frame_list_.end()) { // The last fragment has already received. If all fragments are in // order, then some fragments lost in tranmission and need to be // repaired using FEC return false; } else if (!it->second.FuAStart()) { + complete_frame_size += it->second.PayloadSize(); continue; } else if (it->second.FuAStart()) { + complete_frame_size += it->second.PayloadSize(); if (!nv12_data_) { nv12_data_ = new uint8_t[NV12_BUFFER_SIZE]; }