[FFmpeg-devel] [PATCH 08/12] alsdec: convert VLAs to fixed size

Thilo Borgmann thilo.borgmann
Sun Jun 27 11:46:32 CEST 2010


Am 23.06.10 19:26, schrieb Mans Rullgard:
> The maximum value of sub_blocks is 8, a safe size to always allocate on
> stack.
> ---
>  libavcodec/alsdec.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
> index 2058a85..f75398f 100644
> --- a/libavcodec/alsdec.c
> +++ b/libavcodec/alsdec.c
> @@ -734,8 +734,8 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
>  
>      // read all residuals
>      if (sconf->bgmc) {
> -        unsigned int delta[sub_blocks];
> -        unsigned int k    [sub_blocks];
> +        unsigned int delta[8];
> +        unsigned int k    [8];
>          unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5);
>          unsigned int i = start;

Fine with me.

-Thilo



More information about the ffmpeg-devel mailing list