wmalosslessdec: Fix reading too many bits in decode_channel_residues()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Apr 2012 12:51:24 +0000 (14:51 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Apr 2012 12:51:49 +0000 (14:51 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wmalosslessdec.c

index a806c38..3b68cca 100644 (file)
@@ -520,7 +520,7 @@ static int decode_channel_residues(WmallDecodeCtx *s, int ch, int tile_size)
             residue = quo;
         else {
             rem_bits = av_ceil_log2(ave_mean);
-            rem      = rem_bits ? get_bits(&s->gb, rem_bits) : 0;
+            rem      = get_bits_long(&s->gb, rem_bits);
             residue  = (quo << rem_bits) + rem;
         }