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
This commit is contained in:
magjed@webrtc.org 2014-11-12 08:58:49 +00:00
parent 14ea50a8e3
commit 0b3d89b500

View File

@ -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);