From 49db7b7e4a8f279c896d6c18ae9e9ca04e389bdd Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Fri, 27 Dec 2013 22:54:51 +0000 Subject: [PATCH] Add edge to sobel buffers to avoid overwrites. BUG=296 TESTED=Sobel unittest in Effects R=tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/6429004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@930 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/planar_functions.cc | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.chromium b/README.chromium index 1e274d916..923c55476 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 929 +Version: 930 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 0f779f765..002c53f13 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 929 +#define LIBYUV_VERSION 930 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/planar_functions.cc b/source/planar_functions.cc index 3978f9226..859193ec6 100644 --- a/source/planar_functions.cc +++ b/source/planar_functions.cc @@ -1908,10 +1908,10 @@ static int ARGBSobelize(const uint8* src_argb, int src_stride_argb, } #endif // 3 rows with edges before/after. - const int kRowSize = (width + 15) & ~15; - align_buffer_64(row_y, kEdge + kRowSize * 3); - align_buffer_64(row_sobelx, width); - align_buffer_64(row_sobely, width); + const int kRowSize = (width + kEdge + 15) & ~15; + align_buffer_64(row_y, kEdge + kRowSize * 3 + kEdge); + align_buffer_64(row_sobelx, width + kEdge); + align_buffer_64(row_sobely, width + kEdge); // Convert first row. uint8* row_y0 = row_y + kEdge; @@ -1919,7 +1919,7 @@ static int ARGBSobelize(const uint8* src_argb, int src_stride_argb, uint8* row_y2 = row_y1 + kRowSize; ARGBToBayerRow(src_argb, row_y0, 0x0d090501, width); row_y0[-1] = row_y0[0]; - memset(row_y0 + width, row_y0[width - 1], 16); // extrude 16 pixels. + memset(row_y0 + width, row_y0[width - 1], 16); // Extrude 16 for valgrind. ARGBToBayerRow(src_argb, row_y1, 0x0d090501, width); row_y1[-1] = row_y1[0]; memset(row_y1 + width, row_y1[width - 1], 16);