From c23b817eab57fd25c88f5e68809a2b840a855092 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Fri, 3 Jan 2014 02:13:35 +0000 Subject: [PATCH] 64 bit clip for argb scale down BUG=302 TEST=out\release\libyuv_unittest --gtest_filter=*ARGBScaleDownClipBy3by4* R=tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/6549004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@947 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/scale_argb.cc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.chromium b/README.chromium index d9a8bf0cf..51c55e8ec 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 946 +Version: 947 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 5a77ae714..c68d4e964 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 946 +#define LIBYUV_VERSION 947 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/scale_argb.cc b/source/scale_argb.cc index 079d7400f..c7c73b237 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -171,9 +171,9 @@ static void ScaleARGBBilinearDown(int src_width, int src_height, assert(src_height > 0); assert(dst_width > 0); assert(dst_height > 0); - int xlast = x + (dst_width - 1) * dx; - int xl = (dx >= 0) ? x : xlast; - int xr = (dx >= 0) ? xlast : x; + int64 xlast = x + static_cast(dst_width - 1) * dx; + int64 xl = (dx >= 0) ? x : xlast; + int64 xr = (dx >= 0) ? xlast : x; xl = (xl >> 16) & ~3; // Left edge aligned. xr = (xr >> 16) + 1; // Right most pixel used. int clip_src_width = (((xr - xl) + 1 + 3) & ~3) * 4; // Width aligned to 4.