[FFmpeg-devel] [PATCH 1/6] flacdec: change variable-length array to fixed length

Justin Ruggles justin.ruggles
Wed Aug 19 03:35:03 CEST 2009


Mans Rullgard wrote:

> pred_order can never exceed 64, so always allocating that amount is safe
> and not very wasteful.
> ---
>  libavcodec/flacdec.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
> index 4ff7fae..643ed24 100644
> --- a/libavcodec/flacdec.c
> +++ b/libavcodec/flacdec.c
> @@ -358,7 +358,7 @@ static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order)
>  {
>      int i, j;
>      int coeff_prec, qlevel;
> -    int coeffs[pred_order];
> +    int coeffs[64];
>      int32_t *decoded = s->decoded[channel];
>  
>      /* warm up samples */


That should be 32, not 64.

-Justin




More information about the ffmpeg-devel mailing list