vmdav: more complete check for block_align, prevent out of array access.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Nov 2012 16:44:18 +0000 (17:44 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Nov 2012 19:58:36 +0000 (20:58 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vmdav.c

index 63343fd..6e92e18 100644 (file)
@@ -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);
     }