clamp pointer to max row to avoid stepping off source image.

BUG=292
TESTED=BackgroundOverlayKernelTest.ProcessVideo_ForegroundBackground

Review URL: https://webrtc-codereview.appspot.com/5379004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@905 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
fbarchard@google.com 2013-12-08 21:13:09 +00:00
parent 0db78ad127
commit 5316f38375
4 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 904
Version: 905
License: BSD
License File: LICENSE

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 904
#define LIBYUV_VERSION 905
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT

View File

@ -656,6 +656,7 @@ void ScalePlaneBilinearUp(int src_width, int src_height,
if (y > max_y) {
y = max_y;
yi = y >> 16;
src = src_ptr + yi * src_stride;
}
if (yi != lasty) {
ScaleFilterCols(rowptr, src, dst_width, x, dx);

View File

@ -324,6 +324,7 @@ static void ScaleARGBBilinearUp(int src_width, int src_height,
if (y > max_y) {
y = max_y;
yi = y >> 16;
src = src_argb + yi * src_stride;
}
if (yi != lasty) {
ScaleARGBFilterCols(rowptr, src, dst_width, x, dx);
@ -500,6 +501,10 @@ static void ScaleYUVToARGBBilinearUp(int src_width, int src_height,
if (y > max_y) {
y = max_y;
yi = y >> 16;
uv_yi = yi >> kYShift;
src_row_y = src_y + yi * src_stride_y;
src_row_u = src_u + uv_yi * src_stride_u;
src_row_v = src_v + uv_yi * src_stride_v;
}
if (yi != lasty) {
// TODO(fbarchard): Convert the clipped region of row.