Commit 5316f383 authored by fbarchard@google.com's avatar fbarchard@google.com

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
parent 0db78ad1
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 904
Version: 905
License: BSD
License File: LICENSE
......
......@@ -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
......@@ -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);
......
......@@ -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.
......
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