[FFmpeg-devel] [PATCH]Simplify als error condition

Thilo Borgmann thilo.borgmann at googlemail.com
Sat May 5 12:11:01 CEST 2012


Am 05.05.12 11:24, schrieb Carl Eugen Hoyos:
> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
> index 20ef407..625d111 100644
> --- a/libavcodec/alsdec.c
> +++ b/libavcodec/alsdec.c
> @@ -652,7 +652,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
>              s[k] = s[k - 1] + decode_rice(gb, 0);
>      }

>      for (k = 1; k < sub_blocks; k++)

I think this loop should also check s[k] for k == 0. Would be nice if you could
also push that by another commit or I'll post a patch for that later.

> -        if (s[k] < 0 || s[k] > 32) {
> +        if (s[k] > 32) {
>              av_log(avctx, AV_LOG_ERROR, "k invalid for rice code.\n");
>              return -1;
>          }

patch ok.

-Thilo


More information about the ffmpeg-devel mailing list