summaryrefslogtreecommitdiff
path: root/libavcodec/vmdav.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-24 23:16:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-24 23:42:49 +0200
commit00cbe9e4053fd562b6f21e76aca6636ff926b637 (patch)
treef48a1bcbfcd07b9910f31612a11b0f91b034a417 /libavcodec/vmdav.c
parenteae3cf06a5410cf6d06235de4ceea28e33e53be3 (diff)
downloadffmpeg-00cbe9e4053fd562b6f21e76aca6636ff926b637.tar.gz
Fix potential overread in vmd audio decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vmdav.c')
-rw-r--r--libavcodec/vmdav.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index 919789168e..77e0432610 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -523,7 +523,10 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
silent_chunks = 0;
if (block_type == BLOCK_TYPE_INITIAL) {
- uint32_t flags = AV_RB32(buf);
+ uint32_t flags;
+ if (buf_size < 4)
+ return -1;
+ flags = AV_RB32(buf);
silent_chunks = av_popcount(flags);
buf += 4;
buf_size -= 4;