avcodec/alsdec: fix some undefined shifts
authorPaul B Mahol <onemda@gmail.com>
Mon, 3 Jul 2017 09:48:13 +0000 (11:48 +0200)
committerPaul B Mahol <onemda@gmail.com>
Tue, 4 Jul 2017 07:24:54 +0000 (09:24 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/alsdec.c

index 960c55c..13bd52f 100644 (file)
@@ -761,7 +761,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
             }
 
             for (k = 2; k < opt_order; k++)
-                quant_cof[k] = (quant_cof[k] << 14) + (add_base << 13);
+                quant_cof[k] = (quant_cof[k] * (1 << 14)) + (add_base << 13);
         }
     }
 
@@ -866,7 +866,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
                     res >>= 1;
 
                     if (cur_k) {
-                        res <<= cur_k;
+                        res  *= 1 << cur_k;
                         res  |= get_bits_long(gb, cur_k);
                     }
                 }