From: Hien Ho Date: Fri, 16 Aug 2019 22:48:32 +0000 (-0700) Subject: test/vp9_quantize_test: fix int sanitizer warning X-Git-Tag: v1.8.2~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f52ae2384846b1ccd2c18db75bbb0867c1c9f5e;p=libvpx test/vp9_quantize_test: fix int sanitizer warning implicit conversion from type 'int' of value 42126 (32-bit, signed) to type 'tran_low_t' (aka 'short') changed the value to -23410 (16-bit, signed) BUG=webm:1615 Change-Id: I339c640fce81e9f2dd73ef9c9bee084b6a5638dc --- diff --git a/test/vp9_quantize_test.cc b/test/vp9_quantize_test.cc index d094904f1..a0c883302 100644 --- a/test/vp9_quantize_test.cc +++ b/test/vp9_quantize_test.cc @@ -214,12 +214,15 @@ inline void quant_fp_nz(const tran_low_t *coeff_ptr, intptr_t n_coeffs, tmp = clamp(abs_coeff[y] + _round, INT16_MIN, INT16_MAX); tmp = (tmp * quant_ptr[rc != 0]) >> (16 - is_32x32); qcoeff_ptr[rc] = (tmp ^ coeff_sign[y]) - coeff_sign[y]; - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; + dqcoeff_ptr[rc] = + static_cast(qcoeff_ptr[rc] * dequant_ptr[rc != 0]); if (is_32x32) { - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; + dqcoeff_ptr[rc] = static_cast(qcoeff_ptr[rc] * + dequant_ptr[rc != 0] / 2); } else { - dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; + dqcoeff_ptr[rc] = + static_cast(qcoeff_ptr[rc] * dequant_ptr[rc != 0]); } } else { qcoeff_ptr[rc] = 0;