[FFmpeg-devel] [PATCH 08/16] vmdaudio: validate block type
Kostya
kostya.shishkov
Tue Feb 22 22:50:31 CET 2011
On Tue, Feb 22, 2011 at 02:05:27PM -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