]> granicus.if.org Git - libvpx/commitdiff
vp9/decoder/vp9_detokenize: fix int sanitizer warnings
authorHien Ho <hienho@google.com>
Tue, 1 Oct 2019 23:36:56 +0000 (16:36 -0700)
committerHien Ho <hienho@google.com>
Thu, 3 Oct 2019 18:52:57 +0000 (18:52 +0000)
From unit test: VP9MultiThreaded/InvalidFileTest
implicit conversion from type 'int' of value 83144 (32-bit, signed) to
type 'tran_low_t' (aka 'short') changed the value to 17608 (16-bit,
 signed)

 BUG=webm:1615
 BUG=webm:1648

Change-Id: I4170494c328596ace66432c8563c55f31745cf76

vp9/decoder/vp9_detokenize.c

index e250a5a354d7560c3a070524fc95dd82da7014ea..c2e6b3d545bf0e8a67b7a3d43fcbb91afe21c7a6 100644 (file)
@@ -243,9 +243,9 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type,
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 #else
     if (read_bool(r, 128, &value, &count, &range)) {
-      dqcoeff[scan[c]] = -v;
+      dqcoeff[scan[c]] = (tran_low_t)-v;
     } else {
-      dqcoeff[scan[c]] = v;
+      dqcoeff[scan[c]] = (tran_low_t)v;
     }
 #endif  // CONFIG_COEFFICIENT_RANGE_CHECKING
     ++c;