Initialize memory in I420VideoFrame unittest

Previously, when CreateEmptyFrame was called with a smaller size than before, we would reuse the allocation. Now, we allocate a new tight frame. The CL that made this change is https://webrtc-codereview.appspot.com/42469004/. This exposed an uninitialized memory problem in a I420VideoFrame unittest. This CL fixes that unittest.

R=stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8593}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8593 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
magjed@webrtc.org 2015-03-04 11:30:29 +00:00
parent 487afc704d
commit f82109cb4d

View File

@ -108,6 +108,9 @@ TEST(TestI420VideoFrame, CopyFrame) {
// Frame of larger dimensions.
EXPECT_EQ(0, small_frame.CreateEmptyFrame(width, height,
stride_y, stride_u, stride_v));
memset(small_frame.buffer(kYPlane), 1, small_frame.allocated_size(kYPlane));
memset(small_frame.buffer(kUPlane), 2, small_frame.allocated_size(kUPlane));
memset(small_frame.buffer(kVPlane), 3, small_frame.allocated_size(kVPlane));
EXPECT_EQ(0, big_frame.CopyFrame(small_frame));
EXPECT_TRUE(EqualFrames(small_frame, big_frame));
}