From 4942832928cb1943174f9889404dde476cab94c9 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Sat, 4 Feb 2012 05:23:51 +0000 Subject: [PATCH] Fix "may be used uninitialized" warning. TBR=marpan@webrtc.org BUG= TEST=build on Linux/Release and rtp_rtcp_unittests Review URL: https://webrtc-codereview.appspot.com/381004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1602 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/rtp_rtcp/source/rtp_fec_unittest.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/rtp_rtcp/source/rtp_fec_unittest.cc b/src/modules/rtp_rtcp/source/rtp_fec_unittest.cc index e45adb16d..6726e2c9b 100644 --- a/src/modules/rtp_rtcp/source/rtp_fec_unittest.cc +++ b/src/modules/rtp_rtcp/source/rtp_fec_unittest.cc @@ -507,9 +507,9 @@ void RtpFecTest:: ReceivedPackets( } } - int RtpFecTest::ConstructMediaPackets(int num_media_packets) { - ForwardErrorCorrection::Packet* media_packet; + assert(num_media_packets > 0); + ForwardErrorCorrection::Packet* media_packet = NULL; int sequence_number = rand(); int time_stamp = rand(); @@ -555,6 +555,7 @@ int RtpFecTest::ConstructMediaPackets(int num_media_packets) { sequence_number++; } // Last packet, set marker bit. + assert(media_packet != NULL); media_packet->data[1] |= 0x80; return sequence_number; }