From b3bd1cd5f1d405c795fe490601c733fc78260763 Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Wed, 7 Dec 2011 11:48:09 +0000 Subject: [PATCH] Fixes Valgrind warnings in the default VCM tests. BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/299010 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1120 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/video_coding/main/test/codec_database_test.cc | 2 +- src/modules/video_coding/main/test/generic_codec_test.cc | 1 + src/modules/video_coding/main/test/normal_test.cc | 3 ++- src/modules/video_coding/main/test/test_callbacks.cc | 5 +++-- src/modules/video_coding/main/test/tester_main.cc | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/video_coding/main/test/codec_database_test.cc b/src/modules/video_coding/main/test/codec_database_test.cc index cfdd811f1..7341965b2 100644 --- a/src/modules/video_coding/main/test/codec_database_test.cc +++ b/src/modules/video_coding/main/test/codec_database_test.cc @@ -377,7 +377,7 @@ CodecDataBaseTest::Perform(CmdArgs& args) } // end: iterate codecs rewind(_sourceFile); sourceFrame.Free(); - delete tmpBuffer; + delete [] tmpBuffer; delete decodeCallCDT; delete encodeCallCDT; // closing and calculating PSNR for prior encoder-decoder test diff --git a/src/modules/video_coding/main/test/generic_codec_test.cc b/src/modules/video_coding/main/test/generic_codec_test.cc index 5fdefbaa9..692e5a7ba 100644 --- a/src/modules/video_coding/main/test/generic_codec_test.cc +++ b/src/modules/video_coding/main/test/generic_codec_test.cc @@ -580,6 +580,7 @@ VCMEncComplete_KeyReqTest::SendData( { WebRtcRTPHeader rtpInfo; rtpInfo.header.markerBit = true; // end of frame + rtpInfo.type.Video.codecHeader.VP8.InitRTPVideoHeaderVP8(); rtpInfo.type.Video.codec = kRTPVideoVP8; rtpInfo.header.payloadType = payloadType; rtpInfo.header.sequenceNumber = _seqNo; diff --git a/src/modules/video_coding/main/test/normal_test.cc b/src/modules/video_coding/main/test/normal_test.cc index 34644039b..23b0e915e 100644 --- a/src/modules/video_coding/main/test/normal_test.cc +++ b/src/modules/video_coding/main/test/normal_test.cc @@ -100,6 +100,7 @@ VCMNTEncodeCompleteCallback::SendData( break; case kVideoCodecVP8: rtpInfo.type.Video.codec = kRTPVideoVP8; + rtpInfo.type.Video.codecHeader.VP8.InitRTPVideoHeaderVP8(); rtpInfo.type.Video.codecHeader.VP8.nonReference = videoHdr->codecHeader.VP8.nonReference; rtpInfo.type.Video.codecHeader.VP8.pictureId = @@ -329,7 +330,7 @@ NormalTest::Perform(CmdArgs& args) _testTotalTime = endTime - startTime; _sumEncBytes = _encodeCompleteCallback.EncodedBytes(); - delete tmpBuffer; + delete [] tmpBuffer; delete waitEvent; Teardown(); Print(); diff --git a/src/modules/video_coding/main/test/test_callbacks.cc b/src/modules/video_coding/main/test/test_callbacks.cc index e564b180e..4a4fe004b 100644 --- a/src/modules/video_coding/main/test/test_callbacks.cc +++ b/src/modules/video_coding/main/test/test_callbacks.cc @@ -61,15 +61,16 @@ VCMEncodeCompleteCallback::SendData( rtpInfo.header.markerBit = true; // end of frame rtpInfo.type.Video.isFirstPacket = true; rtpInfo.type.Video.codec = _codecType; + rtpInfo.type.Video.height = (WebRtc_UWord16)_height; + rtpInfo.type.Video.width = (WebRtc_UWord16)_width; switch (_codecType) { case webrtc::kRTPVideoH263: rtpInfo.type.Video.codecHeader.H263.bits = false; rtpInfo.type.Video.codecHeader.H263.independentlyDecodable = false; - rtpInfo.type.Video.height = (WebRtc_UWord16)_height; - rtpInfo.type.Video.width = (WebRtc_UWord16)_width; break; case webrtc::kRTPVideoVP8: + rtpInfo.type.Video.codecHeader.VP8.InitRTPVideoHeaderVP8(); rtpInfo.type.Video.codecHeader.VP8.nonReference = videoHdr->codecHeader.VP8.nonReference; rtpInfo.type.Video.codecHeader.VP8.pictureId = diff --git a/src/modules/video_coding/main/test/tester_main.cc b/src/modules/video_coding/main/test/tester_main.cc index 7e326eb85..1aecf0444 100644 --- a/src/modules/video_coding/main/test/tester_main.cc +++ b/src/modules/video_coding/main/test/tester_main.cc @@ -201,6 +201,7 @@ int main(int argc, char **argv) ret |= CodecDataBaseTest::RunTest(args); ret |= ReceiverTimingTests(args); ret |= JitterBufferTest(args); + break; default: ret = -1; break;