[FFmpeg-cvslog] vmdav: more complete check for block_align, prevent out of array access.

Michael Niedermayer git at videolan.org
Thu Nov 15 21:03:44 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Nov 15 17:44:18 2012 +0100| [c2409a7c5b1c1f43ee8b00c13ed41edc0321db0b] | committer: Michael Niedermayer

vmdav: more complete check for block_align, prevent out of array access.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/vmdav.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index 63343fd..6e92e18 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -497,7 +497,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
         return AVERROR(EINVAL);
     }
-    if (avctx->block_align < 1) {
+    if (avctx->block_align < 1 || avctx->block_align % avctx->channels) {
         av_log(avctx, AV_LOG_ERROR, "invalid block align\n");
         return AVERROR(EINVAL);
     }



More information about the ffmpeg-cvslog mailing list