[FFmpeg-cvslog] Fix potential overread in vmd audio decoder.

Laurent Aimar git at videolan.org
Sat Oct 1 21:38:48 CEST 2011


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Sat Sep 24 23:16:17 2011 +0200| [21c9d92646f375f0c3ff9b2bc7b2f5f07a150e74] | committer: Michael Niedermayer

Fix potential overread in vmd audio decoder.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 00cbe9e4053fd562b6f21e76aca6636ff926b637)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21c9d92646f375f0c3ff9b2bc7b2f5f07a150e74
---

 libavcodec/vmdav.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index b9acfe9..ebc8c7e 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;



More information about the ffmpeg-cvslog mailing list