avcodec/alsdec: fix max bits in ltp prefix code
authorUmair Khan <omerjerk@gmail.com>
Fri, 11 Mar 2016 21:04:30 +0000 (02:34 +0530)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 12 Mar 2016 00:56:58 +0000 (01:56 +0100)
The maximum number of bits int the prefix code for
p(0) is 4. By setting it as 3, we were missing the
last 0 bit.
This fixes bug #4715 present on the trac.

Signed-off-by: Umair Khan <omerjerk@gmail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/alsdec.c

index 81666c5..89e281a 100644 (file)
@@ -765,7 +765,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
             bd->ltp_gain[0]   = decode_rice(gb, 1) << 3;
             bd->ltp_gain[1]   = decode_rice(gb, 2) << 3;
 
-            r                 = get_unary(gb, 0, 3);
+            r                 = get_unary(gb, 0, 4);
             c                 = get_bits(gb, 2);
             bd->ltp_gain[2]   = ltp_gain_values[r][c];