summaryrefslogtreecommitdiff
path: root/modules/video_processing/main
diff options
context:
space:
mode:
authormikhal@webrtc.org <mikhal@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-10-24 21:34:21 +0000
committermikhal@webrtc.org <mikhal@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-10-24 21:34:21 +0000
commitab40aab630d4c30e241d3e6671a550411abd8077 (patch)
treec784f0fc0849ce699662008f2c64fe20a1604597 /modules/video_processing/main
parent5429913ac10876a645336b44502660667b13b6e8 (diff)
downloadwebrtc-ab40aab630d4c30e241d3e6671a550411abd8077.tar.gz
Fix valgrind issue introduced in r2983
Review URL: https://webrtc-codereview.appspot.com/936004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@2986 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'modules/video_processing/main')
-rw-r--r--modules/video_processing/main/test/unit_test/unit_test.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/video_processing/main/test/unit_test/unit_test.cc b/modules/video_processing/main/test/unit_test/unit_test.cc
index 2b06ccd6..967a8f0a 100644
--- a/modules/video_processing/main/test/unit_test/unit_test.cc
+++ b/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;