diff options
author | Yaowu Xu <yaowu@google.com> | 2014-12-30 08:35:40 -0800 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2014-12-30 09:20:36 -0800 |
commit | 32d88c22095d21183e077e360254cef0ef34499c (patch) | |
tree | 0cc8aa0daa39504cb4be8bb0dfda963f4dc10b11 | |
parent | f5d574c566de8f555a3d0dcdb13f0afe0e804d68 (diff) | |
download | libvpx-32d88c22095d21183e077e360254cef0ef34499c.tar libvpx-32d88c22095d21183e077e360254cef0ef34499c.tar.gz libvpx-32d88c22095d21183e077e360254cef0ef34499c.tar.bz2 libvpx-32d88c22095d21183e077e360254cef0ef34499c.zip |
Properly set size based on actual buffer layout
VP9FrameSizeTestsLarge.OneByOneVideo has been causing a failure in
jenkins libvpx__unit_tests-valgrind_long for "using of uninitialized
memory", the root cause was that the input image for this test was
not initialized with proper size, therefore plan U and V were not
initialized at all.
This commit fixes the size initialization, and resolves the issue.
Change-Id: Ic4dd1542b7bb0cb260a1e0aeeb505db21ae5edc8
-rw-r--r-- | test/encode_test_driver.cc | 3 | ||||
-rw-r--r-- | test/video_source.h | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc index 7a133643d..77135ec6d 100644 --- a/test/encode_test_driver.cc +++ b/test/encode_test_driver.cc @@ -64,8 +64,7 @@ void Encoder::EncodeFrameInternal(const VideoSource &video, // Encode the frame API_REGISTER_STATE_CHECK( - res = vpx_codec_encode(&encoder_, - video.img(), video.pts(), video.duration(), + res = vpx_codec_encode(&encoder_, img, video.pts(), video.duration(), frame_flags, deadline_)); ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); } diff --git a/test/video_source.h b/test/video_source.h index 84bfa8e53..b97e1550e 100644 --- a/test/video_source.h +++ b/test/video_source.h @@ -175,8 +175,8 @@ class DummyVideoSource : public VideoSource { void SetSize(unsigned int width, unsigned int height) { if (width != width_ || height != height_) { vpx_img_free(img_); - raw_sz_ = ((width + 31)&~31) * height * 3 / 2; img_ = vpx_img_alloc(NULL, VPX_IMG_FMT_I420, width, height, 32); + raw_sz_ = ((img_->w + 31) & ~31) * img_->h * 3 / 2; width_ = width; height_ = height; } |