avcodec/dvdec: Fix "left shift of negative value -254"
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 10 Jan 2016 16:43:56 +0000 (17:43 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 10 Jan 2016 16:44:33 +0000 (17:44 +0100)
Fixes: dvdec_left_shift.avi

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/dvdec.c

index b75bcb9..0b4c1bc 100644 (file)
@@ -347,7 +347,7 @@ retry:
                                     dct_mode                        * 22 * 64 +
                                     (quant + ff_dv_quant_offset[class1]) * 64];
             }
-            dc = dc << 2;
+            dc = dc * 4;
             /* convert to unsigned because 128 is not added in the
              * standard IDCT */
             dc                   += 1024;