[FFmpeg-devel] [PATCH] rv34: kill VLAs

Kostya kostya.shishkov
Fri Jun 25 06:44:46 CEST 2010


On Fri, Jun 25, 2010 at 12:01:06AM +0100, Mans Rullgard wrote:
> ---
>  libavcodec/rv34.c    |    4 ++--
>  libavcodec/rv34vlc.h |    1 +
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
> index 88652f9..fa3f23f 100644
> --- a/libavcodec/rv34.c
> +++ b/libavcodec/rv34.c
> @@ -103,8 +103,8 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t
>  {
>      int i;
>      int counts[17] = {0}, codes[17];
> -    uint16_t cw[size], syms[size];
> -    uint8_t bits2[size];
> +    uint16_t cw[MAX_VLC_SIZE], syms[MAX_VLC_SIZE];
> +    uint8_t bits2[MAX_VLC_SIZE];
>      int maxbits = 0, realsize = 0;
>  
>      for(i = 0; i < size; i++){
> diff --git a/libavcodec/rv34vlc.h b/libavcodec/rv34vlc.h
> index 2b89e4c..aa29357 100644
> --- a/libavcodec/rv34vlc.h
> +++ b/libavcodec/rv34vlc.h
> @@ -37,6 +37,7 @@
>  #define FIRSTBLK_VLC_SIZE  864
>  #define OTHERBLK_VLC_SIZE  108
>  #define COEFF_VLC_SIZE      32
> +#define MAX_VLC_SIZE      1296
>  
>  static const uint8_t rv34_table_intra_cbppat[NUM_INTRA_TABLES][2][CBPPAT_VLC_SIZE] = {
>    {
> -- 

definitely ok



More information about the ffmpeg-devel mailing list