wavpack: use get_bits_long to read up to 32 bits

get_bits should not be used for more than 25 bits.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
Andreas Cadhalpun 2015-06-27 20:16:12 +02:00
parent 317be53ca6
commit f9883a669c
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
if (t >= 2) { if (t >= 2) {
if (get_bits_left(gb) < t - 1) if (get_bits_left(gb) < t - 1)
goto error; goto error;
t = get_bits(gb, t - 1) | (1 << (t - 1)); t = get_bits_long(gb, t - 1) | (1 << (t - 1));
} else { } else {
if (get_bits_left(gb) < 0) if (get_bits_left(gb) < 0)
goto error; goto error;
@ -186,7 +186,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
} else { } else {
if (get_bits_left(gb) < t2 - 1) if (get_bits_left(gb) < t2 - 1)
goto error; goto error;
t += get_bits(gb, t2 - 1) | (1 << (t2 - 1)); t += get_bits_long(gb, t2 - 1) | (1 << (t2 - 1));
} }
} }