warped_motion: Fix ubsan warning for signed integer overflow Change-Id: Ie698aa02ef56128759c71079e9bfa1af25149644
diff --git a/av1/common/warped_motion.c b/av1/common/warped_motion.c index f73e777..89534de 100644 --- a/av1/common/warped_motion.c +++ b/av1/common/warped_motion.c
@@ -215,7 +215,7 @@ } else if (x == (1 << WARPEDPIXEL_PREC_BITS)) { return p[1]; } else { - const int64_t v1 = x * x * x * (3 * (p[0] - p[1]) + p[2] - p[-1]); + const int64_t v1 = (int64_t)x * x * x * (3 * (p[0] - p[1]) + p[2] - p[-1]); const int64_t v2 = x * x * (2 * p[-1] - 5 * p[0] + 4 * p[1] - p[2]); const int64_t v3 = x * (p[1] - p[-1]); const int64_t v4 = 2 * p[0];