Reorder operations to avoid uint32_t overflow Change-Id: I4af6f70f85621b3bd747352621aa7478649ec2fb
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index f70f8ce..1d78ae8 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c
@@ -6231,10 +6231,10 @@ pred1 + bh / 2 * stride1 + bw / 2, stride0, &esq[1][3]); - tl = (int64_t)(esq[0][0] + esq[0][1] + esq[0][2]) - - (int64_t)(esq[1][0] + esq[1][1] + esq[1][2]); - br = (int64_t)(esq[1][3] + esq[1][1] + esq[1][2]) - - (int64_t)(esq[0][3] + esq[0][1] + esq[0][2]); + tl = ((int64_t)esq[0][0] + esq[0][1] + esq[0][2]) - + ((int64_t)esq[1][0] + esq[1][1] + esq[1][2]); + br = ((int64_t)esq[1][3] + esq[1][1] + esq[1][2]) - + ((int64_t)esq[0][3] + esq[0][1] + esq[0][2]); return (tl + br > 0); }