]> granicus.if.org Git - libvpx/commitdiff
vp8/decoder/decodeframe: fix int sanitizer warnings
authorHien Ho <hienho@google.com>
Thu, 3 Oct 2019 19:15:14 +0000 (12:15 -0700)
committerHien Ho <hienho@google.com>
Thu, 3 Oct 2019 23:34:50 +0000 (23:34 +0000)
Unit test: VP8/InvalidFileTest
implicit conversion from type 'int' of value -45844 (32-bit, signed) to
type 'short' changed the value to 19692 (16-bit, signed)

 BUG=webm:1615
 BUG=webm:1644

Change-Id: Id5d470f706d68e24f7a1e689526c9ecd3a8e8db8

vp8/decoder/decodeframe.c

index 650d1d0408d9395a2df50ad903be430a2940d942..b26b1ae20d2904eb9507003c6f088d125ef1dfd2 100644 (file)
@@ -211,7 +211,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
           vp8_short_inv_walsh4x4(&b->dqcoeff[0], xd->qcoeff);
           memset(b->qcoeff, 0, 16 * sizeof(b->qcoeff[0]));
         } else {
-          b->dqcoeff[0] = b->qcoeff[0] * xd->dequant_y2[0];
+          b->dqcoeff[0] = (short)(b->qcoeff[0] * xd->dequant_y2[0]);
           vp8_short_inv_walsh4x4_1(&b->dqcoeff[0], xd->qcoeff);
           memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0]));
         }