diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-02-23 21:11:05 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-02-24 05:10:12 +0300 |
commit | 22f893e1c9f9387f0a021f775757130fa48e0180 (patch) | |
tree | b6e5f10ebb5fa8fd46403fd7f5099fb9242e0d4c /libavcodec/vmdav.c | |
parent | dd1af5136fe7767f2f18ac943efe994946864640 (diff) |
vmdaudio: validate block type
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/vmdav.c')
-rw-r--r-- | libavcodec/vmdav.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index a528d91190..b338da3904 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -518,6 +518,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 */ |