From 0b3d89b50059da945eee920a8c056c5ee8b5819d Mon Sep 17 00:00:00 2001 From: "magjed@webrtc.org" Date: Wed, 12 Nov 2014 08:58:49 +0000 Subject: [PATCH] VideoSendStreamTest.SwapsI420VideoFrames: Initialize frame memory to avoid drmemory errors R=pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/27149004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7688 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/video/video_send_stream_tests.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc index 3ab112744..b5f5d8851 100644 --- a/webrtc/video/video_send_stream_tests.cc +++ b/webrtc/video/video_send_stream_tests.cc @@ -296,9 +296,14 @@ TEST_F(VideoSendStreamTest, SwapsI420VideoFrames) { send_stream_->Start(); I420VideoFrame frame; - frame.CreateEmptyFrame( - kWidth, kHeight, kWidth, (kWidth + 1) / 2, (kWidth + 1) / 2); + const int stride_uv = (kWidth + 1) / 2; + frame.CreateEmptyFrame(kWidth, kHeight, kWidth, stride_uv, stride_uv); uint8_t* old_y_buffer = frame.buffer(kYPlane); + // Initialize memory to avoid DrMemory errors. + const int half_height = (kHeight + 1) / 2; + memset(frame.buffer(kYPlane), 0, kWidth * kHeight); + memset(frame.buffer(kUPlane), 0, stride_uv * half_height); + memset(frame.buffer(kVPlane), 0, stride_uv * half_height); send_stream_->Input()->SwapFrame(&frame);