From f0ada0e90b5115e9d10bc328f243465e0130e108 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Fri, 21 Sep 2012 01:00:40 +0000 Subject: [PATCH] Pad source RGB buffer by 16 to allow overread in ARGBToRGB24 BUG=94 TEST=Build bots Review URL: https://webrtc-codereview.appspot.com/827004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@370 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/planar_test.cc | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.chromium b/README.chromium index 4118fed76..c065f08da 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 368 +Version: 370 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index e8ce9f9e0..823928936 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 368 +#define LIBYUV_VERSION 370 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/planar_test.cc b/unit_test/planar_test.cc index 0cedbe5c3..15e96559a 100644 --- a/unit_test/planar_test.cc +++ b/unit_test/planar_test.cc @@ -320,13 +320,14 @@ TESTATOB(YUY2, 2, 2, ARGB, 4) TESTATOB(UYVY, 2, 2, ARGB, 4) TESTATOB(M420, 3 / 2, 1, ARGB, 4) +static const int kReadPad = 16; // Allow overread of 16 bytes. #define TESTATOBRANDOM(FMT_A, BPP_A, STRIDE_A, FMT_B, BPP_B) \ TEST_F(libyuvTest, FMT_A##To##FMT_B##_Random) { \ srandom(time(NULL)); \ for (int times = 0; times < benchmark_iterations_; ++times) { \ const int kWidth = (random() & 63) + 1; \ const int kHeight = (random() & 31) + 1; \ - align_buffer_page_end(src_argb, (kWidth * BPP_A) * kHeight); \ + align_buffer_page_end(src_argb, (kWidth * BPP_A) * kHeight + kReadPad); \ align_buffer_page_end(dst_argb_c, (kWidth * BPP_B) * kHeight); \ align_buffer_page_end(dst_argb_opt, (kWidth * BPP_B) * kHeight); \ for (int i = 0; i < kHeight * kWidth * BPP_A; ++i) { \