Clear empty video frames in unittest so DrMemory will allow them to be read without an uninitialized read error.

BUG=libyuv:263
TESTED=drmemory out\Debug\modules_unittests.exe --gtest_filter=*PreprocessorLogic
R=kjellander@webrtc.org, mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/4319004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5168 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fbarchard@google.com
2013-11-25 09:06:33 +00:00
parent aa74b5d690
commit b5bc098e20
2 changed files with 80 additions and 91 deletions

View File

@ -45,7 +45,10 @@ void VideoProcessingModuleTest::SetUp() {
ASSERT_EQ(0, video_frame_.CreateEmptyFrame(width_, height_, width_,
half_width_, half_width_));
// Clear video frame so DrMemory/Valgrind will allow reads of the buffer.
memset(video_frame_.buffer(kYPlane), 0, video_frame_.allocated_size(kYPlane));
memset(video_frame_.buffer(kUPlane), 0, video_frame_.allocated_size(kUPlane));
memset(video_frame_.buffer(kVPlane), 0, video_frame_.allocated_size(kVPlane));
const std::string video_file =
webrtc::test::ResourcePath("foreman_cif", "yuv");
source_file_ = fopen(video_file.c_str(),"rb");