]> granicus.if.org Git - libvpx/commitdiff
Fix an ubsan warning: vp9_quantizer.c
authorYaowu Xu <yaowu@google.com>
Thu, 16 Jun 2016 00:59:26 +0000 (17:59 -0700)
committerYaowu Xu <yaowu@google.com>
Thu, 16 Jun 2016 15:23:21 +0000 (15:23 +0000)
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219

Change-Id: Ie1bfda4d51c1567f551515f0ed113eec1bc1d98c

vp9/encoder/vp9_quantize.c

index 9766c059cf48601c0fe60f780baaa0603bf1494c..d68b6845c227cc2cac26ec62d69cb0d15ede2d4b 100644 (file)
@@ -94,7 +94,7 @@ void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr,
       const int coeff_sign = (coeff >> 31);
       const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
       const int64_t tmp = abs_coeff + round_ptr[rc != 0];
-      const uint32_t abs_qcoeff = (uint32_t)((tmp * quant_ptr[rc != 0]) >> 16);
+      const int abs_qcoeff = (int)((tmp * quant_ptr[rc != 0]) >> 16);
       qcoeff_ptr[rc] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
       dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0];
       if (abs_qcoeff)