[FFmpeg-cvslog] vmdaudio: validate block type

Justin Ruggles git
Sat Feb 26 04:51:52 CET 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Feb 23 13:11:05 2011 -0500| [ebed7b6865761d0d903757c5121ca2dbfba055dd] | committer: Michael Niedermayer

vmdaudio: validate block type

Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>
(cherry picked from commit 22f893e1c9f9387f0a021f775757130fa48e0180)

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

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

diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index a528d91..b338da3 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 */




More information about the ffmpeg-cvslog mailing list