From 567d5077076be6f50881e10cddd97ade0339cf60 Mon Sep 17 00:00:00 2001 From: "marpan@webrtc.org" Date: Fri, 10 Feb 2012 18:56:14 +0000 Subject: [PATCH] Fixes a bug when number of media packets in a frame is larger than maximum allowed for the generateFEC. Review URL: https://webrtc-codereview.appspot.com/391003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1673 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/rtp_rtcp/source/rtp_sender_video.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/rtp_rtcp/source/rtp_sender_video.cc b/src/modules/rtp_rtcp/source/rtp_sender_video.cc index 0f37f663b..4172f1243 100644 --- a/src/modules/rtp_rtcp/source/rtp_sender_video.cc +++ b/src/modules/rtp_rtcp/source/rtp_sender_video.cc @@ -221,7 +221,12 @@ RTPSenderVideo::SendVideoPacket(const FrameType frameType, packetToSend->rtpHeaderLength); _rtpPacketListFec.pop_front(); - _mediaPacketListFec.pop_front(); + // Check if _mediaPacketListFec is non-empty. + // This list may be smaller than rtpPacketList, if the frame + // has more than kMaxMediaPackets. + if (!_mediaPacketListFec.empty()) { + _mediaPacketListFec.pop_front(); + } // Send normal packet with RED header int packetSuccess = _rtpSender.SendToNetwork(