]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/wmalosslessdec: Check block_align maximum
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 9 Jun 2020 20:11:23 +0000 (22:11 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 Jun 2020 22:43:09 +0000 (00:43 +0200)
Fixes: Assertion failure
Fixes: 22737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5958388889681920
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/wmalosslessdec.c

index cfdd9e9a85140508deab79b30b5111f8bcaef5e9..62d5fadf5d693baf42a35042fde773d14c483cff 100644 (file)
@@ -184,7 +184,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     unsigned int channel_mask;
     int i, log2_max_num_subframes;
 
-    if (avctx->block_align <= 0) {
+    if (avctx->block_align <= 0 || avctx->block_align > (1<<21)) {
         av_log(avctx, AV_LOG_ERROR, "block_align is not set or invalid\n");
         return AVERROR(EINVAL);
     }