aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vmdav.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-02-23 13:11:05 -0500
committerMichael Niedermayer <michaelni@gmx.at>2011-02-26 03:16:02 +0100
commitebed7b6865761d0d903757c5121ca2dbfba055dd (patch)
tree9b046a7bb20b0e7b39c4f94a510a984fba862cf7 /libavcodec/vmdav.c
parent149d36877a000ed779812552fd245049cccc1927 (diff)
downloadffmpeg-ebed7b6865761d0d903757c5121ca2dbfba055dd.tar.gz
vmdaudio: validate block type
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit 22f893e1c9f9387f0a021f775757130fa48e0180)
Diffstat (limited to 'libavcodec/vmdav.c')
-rw-r--r--libavcodec/vmdav.c4
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 */