Commit 49db7b7e authored by fbarchard@google.com's avatar fbarchard@google.com

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
parent 6b6eb8cd
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 929 Version: 930
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 929 #define LIBYUV_VERSION 930
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -1908,10 +1908,10 @@ static int ARGBSobelize(const uint8* src_argb, int src_stride_argb, ...@@ -1908,10 +1908,10 @@ static int ARGBSobelize(const uint8* src_argb, int src_stride_argb,
} }
#endif #endif
// 3 rows with edges before/after. // 3 rows with edges before/after.
const int kRowSize = (width + 15) & ~15; const int kRowSize = (width + kEdge + 15) & ~15;
align_buffer_64(row_y, kEdge + kRowSize * 3); align_buffer_64(row_y, kEdge + kRowSize * 3 + kEdge);
align_buffer_64(row_sobelx, width); align_buffer_64(row_sobelx, width + kEdge);
align_buffer_64(row_sobely, width); align_buffer_64(row_sobely, width + kEdge);
// Convert first row. // Convert first row.
uint8* row_y0 = row_y + kEdge; uint8* row_y0 = row_y + kEdge;
...@@ -1919,7 +1919,7 @@ static int ARGBSobelize(const uint8* src_argb, int src_stride_argb, ...@@ -1919,7 +1919,7 @@ static int ARGBSobelize(const uint8* src_argb, int src_stride_argb,
uint8* row_y2 = row_y1 + kRowSize; uint8* row_y2 = row_y1 + kRowSize;
ARGBToBayerRow(src_argb, row_y0, 0x0d090501, width); ARGBToBayerRow(src_argb, row_y0, 0x0d090501, width);
row_y0[-1] = row_y0[0]; 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); ARGBToBayerRow(src_argb, row_y1, 0x0d090501, width);
row_y1[-1] = row_y1[0]; row_y1[-1] = row_y1[0];
memset(row_y1 + width, row_y1[width - 1], 16); memset(row_y1 + width, row_y1[width - 1], 16);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment