[FFmpeg-devel] [PATCH 08/16] vmdaudio: validate block type

Kostya kostya.shishkov
Wed Feb 23 19:59:38 CET 2011


On Wed, Feb 23, 2011 at 01:11:05PM -0500, Justin Ruggles wrote:
> ---
>  libavcodec/vmdav.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 

> diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
> index 0a77d37..da1852a 100644
> --- a/libavcodec/vmdav.c
> +++ b/libavcodec/vmdav.c
> @@ -515,6 +515,10 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
>          return buf_size;
>  
>      block_type = buf[6];
> +    if (block_type < BLOCK_TYPE_AUDIO || block_type > BLOCK_TYPE_SILENCE) {
> +        av_log(avctx, AV_LOG_ERROR, "unknown block type: %d\n", block_type);
> +        return AVERROR(EINVAL);
> +    }
>  
>      if (block_type == BLOCK_TYPE_AUDIO) {
>          /* the chunk contains audio */

ok



More information about the ffmpeg-devel mailing list