[FFmpeg-devel] [PATCH] check sampling index validity when parsing adts frame header

Alex Converse alex.converse
Mon Feb 9 08:11:26 CET 2009


> Index: libavcodec/aac.c
> ===================================================================
> --- libavcodec/aac.c	(revision 16998)
> +++ libavcodec/aac.c	(working copy)
> @@ -1529,6 +1529,11 @@
>          if (hdr_info.chan_config)
>              ac->m4ac.chan_config = hdr_info.chan_config;
>          ac->m4ac.sample_rate     = hdr_info.sample_rate;
> +
> +        if(hdr_info.sampling_index > 11) {

12 is a valid sampling index. It corresponds to 7350 Hz.

> +            av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", hdr_info.sampling_index);
> +            return -1;
> +        }
>          ac->m4ac.sampling_index  = hdr_info.sampling_index;
>          ac->m4ac.object_type     = hdr_info.object_type;
>      }

--Alex




More information about the ffmpeg-devel mailing list