[FFmpeg-cvslog] avcodec/wmavoice: sanity check block_align

Michael Niedermayer git at videolan.org
Mon Feb 3 01:12:43 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Dec 21 22:27:37 2019 +0100| [6847e22c8c85b80bf1d25ec66f77f7ccbcf43aed] | committer: Michael Niedermayer

avcodec/wmavoice: sanity check block_align

This limit is roughly based on the bitreader limit, its likely a much tighter limit
could be used

Fixes: left shift of 1965039647 by 1 places cannot be represented in type 'int'
Fixes: 19545/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5695391899320320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 85c80ecca8..fcbee0ef8e 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -386,7 +386,7 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
                ctx->extradata_size);
         return AVERROR_INVALIDDATA;
     }
-    if (ctx->block_align <= 0) {
+    if (ctx->block_align <= 0 || ctx->block_align > (1<<22)) {
         av_log(ctx, AV_LOG_ERROR, "Invalid block alignment %d.\n", ctx->block_align);
         return AVERROR_INVALIDDATA;
     }



More information about the ffmpeg-cvslog mailing list