]> granicus.if.org Git - libvpx/commitdiff
Fix an overflow warning in optimize_b()
authorhui su <huisu@google.com>
Mon, 23 Jan 2017 19:25:31 +0000 (11:25 -0800)
committerhui su <huisu@google.com>
Wed, 25 Jan 2017 18:54:39 +0000 (10:54 -0800)
BUG=webm:1361

Change-Id: Ib840bf3b39f7b3c8c017d3488a83434e9a0f45f5

vp9/encoder/vp9_encodemb.c

index 2cb137d8b9317aa55764fa21bf9e4ef11a239cf8..80881899a14f93ca2984b880351b40548fe06635 100644 (file)
@@ -102,7 +102,7 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
   const int16_t *const nb = so->neighbors;
   const int dq_step[2] = { dequant_ptr[0] >> shift, dequant_ptr[1] >> shift };
   int next = eob, sz = 0;
-  const int64_t rdmult = (mb->rdmult * plane_rd_mult[ref][type]) >> 1;
+  const int64_t rdmult = ((int64_t)mb->rdmult * plane_rd_mult[ref][type]) >> 1;
   const int64_t rddiv = mb->rddiv;
   int64_t rd_cost0, rd_cost1;
   int rate0, rate1;