shithub: libvpx

Download patch

ref: 2f52ae2384846b1ccd2c18db75bbb0867c1c9f5e
parent: 232ff9361e5f18189c18e874deb6868db04d7b5b
author: Hien Ho <hienho@google.com>
date: Fri Aug 16 11:48:32 EDT 2019

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

--- a/test/vp9_quantize_test.cc
+++ b/test/vp9_quantize_test.cc
@@ -214,12 +214,15 @@
         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<tran_low_t>(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<tran_low_t>(qcoeff_ptr[rc] *
+                                                    dequant_ptr[rc != 0] / 2);
         } else {
-          dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0];
+          dqcoeff_ptr[rc] =
+              static_cast<tran_low_t>(qcoeff_ptr[rc] * dequant_ptr[rc != 0]);
         }
       } else {
         qcoeff_ptr[rc] = 0;