From 1997ddb7137d7a18edcef4969075f19c9b5ac811 Mon Sep 17 00:00:00 2001 From: "mikhal@webrtc.org" Date: Wed, 24 Oct 2012 21:34:21 +0000 Subject: [PATCH] Fix valgrind issue introduced in r2983 Review URL: https://webrtc-codereview.appspot.com/936004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2986 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../video_processing/main/test/unit_test/unit_test.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc b/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc index 2b06ccd6ea..967a8f0af4 100644 --- a/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc +++ b/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc @@ -33,10 +33,10 @@ VideoProcessingModuleTest::VideoProcessingModuleTest() : _vpm(NULL), _sourceFile(NULL), _width(352), - _half_width(_width / 2), + _half_width((_width + 1) / 2), _height(288), _size_y(_width * _height), - _size_uv(_half_width * _height /2), + _size_uv(_half_width * ((_height + 1) / 2)), _frame_length(CalcBufferSize(kI420, _width, _height)) { } @@ -72,6 +72,9 @@ void VideoProcessingModuleTest::TearDown() TEST_F(VideoProcessingModuleTest, HandleNullBuffer) { VideoProcessingModule::FrameStats stats; + memset(_videoFrame.buffer(kYPlane), 0, _size_y); + memset(_videoFrame.buffer(kUPlane), 0, _size_uv); + memset(_videoFrame.buffer(kVPlane), 0, _size_uv); ASSERT_EQ(0, _vpm->GetFrameStats(&stats, _videoFrame)); // Video frame with unallocated buffer. I420VideoFrame videoFrame;