aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-12-21 22:27:37 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-05-19 17:17:35 +0200
commit06df6bfdb423f78637d795125eb2e0c39cf08b00 (patch)
tree860550a02077c9e800b396e687f25cc1ee38a51d
parent38a05c972215b35f95cc063dcdcca16ab0c98e16 (diff)
downloadffmpeg-06df6bfdb423f78637d795125eb2e0c39cf08b00.tar.gz
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@niedermayer.cc> (cherry picked from commit 6847e22c8c85b80bf1d25ec66f77f7ccbcf43aed) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmavoice.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 5f8987ac38..db1ea3fa1e 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;
}