On 27/06/15 20:19, Andreas Cadhalpun wrote:
> get_bits should not be used for more than 25 bits.
> 
> Signed-off-by: Andreas Cadhalpun <[email protected]>
> ---
>  libavcodec/wavpack.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
> index b51a21c..d91b66c 100644
> --- a/libavcodec/wavpack.c
> +++ b/libavcodec/wavpack.c
> @@ -155,7 +155,7 @@ static int wv_get_value(WavpackFrameContext *ctx, 
> GetBitContext *gb,
>              if (t >= 2) {
>                  if (get_bits_left(gb) < t - 1)
>                      goto error;
> -                t = get_bits(gb, t - 1) | (1 << (t - 1));
> +                t = get_bits_long(gb, t - 1) | (1 << (t - 1));
>              } else {
>                  if (get_bits_left(gb) < 0)
>                      goto error;
> @@ -186,7 +186,7 @@ static int wv_get_value(WavpackFrameContext *ctx, 
> GetBitContext *gb,
>              } else {
>                  if (get_bits_left(gb) < t2 - 1)
>                      goto error;
> -                t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
> +                t += get_bits_long(gb, t2 - 1) | (1 << (t2 - 1));
>              }
>          }
>  
> 

Uses get_unary_0_33, looks fine.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to