[FFmpeg-cvslog] r12593 - trunk/libavcodec/ac3dec.c

Justin Ruggles justinruggles
Wed Mar 26 00:38:08 CET 2008


jbr wrote:
> Modified: trunk/libavcodec/ac3dec.c
> ==============================================================================
> --- trunk/libavcodec/ac3dec.c	(original)
> +++ trunk/libavcodec/ac3dec.c	Wed Mar 26 00:34:00 2008
> @@ -39,6 +39,9 @@
>  #include "dsputil.h"
>  #include "random.h"
>  
> +/** Maximum possible frame size when the specification limit is ignored */
> +#define AC3_MAX_FRAME_SIZE 21695
> +
>  /**
>   * Table of bin locations for rematrixing bands
>   * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions
> @@ -191,6 +194,7 @@ typedef struct {
>      GetBitContext gbc;                      ///< bitstream reader
>      AVRandomState dith_state;               ///< for dither generation
>      AVCodecContext *avctx;                  ///< parent context
> +    uint8_t input_buffer[AC3_MAX_FRAME_SIZE];   ///< temp buffer to prevent overread
>  } AC3DecodeContext;

Right after I applied this, it occurred to me that it might be better to
allocate this with av_malloc() at decoder init depending on
error_resiliance.  Does that sound like a good idea?

-Justin




More information about the ffmpeg-cvslog mailing list