From 307c1ff20c88ae59309baa48674eb65457304a8a Mon Sep 17 00:00:00 2001 From: "marpan@webrtc.org" Date: Sat, 4 Feb 2012 02:45:22 +0000 Subject: [PATCH] Fix for issue #254: windows crash of test_fec. Review URL: https://webrtc-codereview.appspot.com/379010 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1600 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/rtp_rtcp/test/testFec/test_fec.cc | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/rtp_rtcp/test/testFec/test_fec.cc b/src/modules/rtp_rtcp/test/testFec/test_fec.cc index 927135568..a30ed6337 100644 --- a/src/modules/rtp_rtcp/test/testFec/test_fec.cc +++ b/src/modules/rtp_rtcp/test/testFec/test_fec.cc @@ -255,7 +255,7 @@ int main() { (mediaPacket->data[1] & 0x80) != 0; } mediaPacketIdx++; - mediaPacketListItem++; + ++mediaPacketListItem; } memset(fecLossMask, 0, sizeof(fecLossMask)); std::list::iterator @@ -288,7 +288,7 @@ int main() { } fecPacketIdx++; seqNum++; - fecPacketListItem++; + ++fecPacketListItem; } #ifdef VERBOSE_OUTPUT @@ -318,7 +318,7 @@ int main() { } } std::list::iterator itemToDelete = fecMaskIt; - fecMaskIt++; + ++fecMaskIt; if (hammingDist == 1) { // Recovery possible. Restart search. @@ -356,7 +356,7 @@ int main() { if (receivedPacket->isFec) { fecPacketReceived = true; } - toDecodeIt++; + ++toDecodeIt; } } if (fec.DecodeFEC(&toDecodeList, &recoveredPacketList, seqNum, @@ -422,7 +422,7 @@ int main() { recoveredPacketList.pop_front(); } mediaPacketIdx++; - mediaPacketListItem++; + ++mediaPacketListItem; } if (!recoveredPacketList.empty()) { printf("Error: excessive number of recovered packets.\n"); @@ -434,14 +434,14 @@ int main() { mediaPacketListItem = mediaPacketList.begin(); while (mediaPacketListItem != mediaPacketList.end()) { delete *mediaPacketListItem; - mediaPacketListItem++; + ++mediaPacketListItem; mediaPacketList.pop_front(); } assert(mediaPacketList.empty()); fecPacketListItem = fecPacketList.begin(); while (fecPacketListItem != fecPacketList.end()) { - fecPacketListItem++; + ++fecPacketListItem; fecPacketList.pop_front(); } @@ -453,7 +453,7 @@ int main() { receivedPacket = *receivedPacketIt; delete receivedPacket->pkt; delete receivedPacket; - receivedPacketIt++; + ++receivedPacketIt; receivedPacketList.pop_front(); } assert(receivedPacketList.empty()); @@ -492,9 +492,9 @@ void ReceivePackets( // Reorder packets. float randomVariable = static_cast(rand()) / RAND_MAX; while (randomVariable < reorderRate) { - it++; + ++it; if (it == receivedPacketList->end()) { - it++; + --it; break; } randomVariable = static_cast(rand()) / RAND_MAX;