From cded3e566baf6046a738b90cf71f956d473aa297 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Thu, 13 Sep 2012 11:19:00 +0000 Subject: [PATCH] interpolate stores/restores an extra byte, so asan complains about the potential danger. This pads the buffer by 16, which is what the user is expected to do, for now at least. BUG=81 TESTED=asan on unittests Review URL: https://webrtc-codereview.appspot.com/799005 git-svn-id: http://libyuv.googlecode.com/svn/trunk@349 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/planar_test.cc | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.chromium b/README.chromium index f99f1ff87..3d6381379 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 348 +Version: 349 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index ae250fbea..20bfd41cd 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 348 +#define LIBYUV_VERSION 349 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/planar_test.cc b/unit_test/planar_test.cc index f8c87a0d4..89b9d354f 100644 --- a/unit_test/planar_test.cc +++ b/unit_test/planar_test.cc @@ -848,11 +848,15 @@ TEST_F(libyuvTest, TestShade) { } } -// TODO(fbarchard): Fix asan warning in this test. libyuv bug #81 -TEST_F(libyuvTest, DISABLED_TestInterpolate) { +TEST_F(libyuvTest, TestInterpolate) { + // Interpolate internally used bilinear filtering, which duplicates the last + // value, but the interpolate saves and restores it. The buffer must be + // padded by 16 extra bytes. TODO(fbarchard): Reimplement interpolate with + // code that does not duplicate the last value and remove kPad. + const int kPad = 16; SIMD_ALIGNED(uint8 orig_pixels_0[256][4]); SIMD_ALIGNED(uint8 orig_pixels_1[256][4]); - SIMD_ALIGNED(uint8 interpolate_pixels[256][4]); + SIMD_ALIGNED(uint8 interpolate_pixels[256 + kPad][4]); orig_pixels_0[0][0] = 16u; orig_pixels_0[0][1] = 32u;