diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-23 22:32:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-06 20:30:57 +0100 |
commit | f1b32668dc33f14ecec0bd550a3912ea67d305b4 (patch) | |
tree | 7cde2be96f8f4da9ad8dd0c8ab3caf8ca200bcd1 | |
parent | f5fdab6b0e412570a999ca65cca4537e05962999 (diff) | |
download | ffmpeg-f1b32668dc33f14ecec0bd550a3912ea67d305b4.tar.gz |
avcodec/wmavoice: Check sample_rate
Fixes: left shift of 538976288 by 8 places cannot be represented in type 'int'
Fixes: 18376/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5741645391200256
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 55c97a763783540ee48a326a3e82fbdea42f8280)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/wmavoice.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 029dfdd8bf..b3c33389cd 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -405,6 +405,9 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx) return AVERROR_INVALIDDATA; } + if (ctx->sample_rate >= INT_MAX / (256 * 37)) + return AVERROR_INVALIDDATA; + s->min_pitch_val = ((ctx->sample_rate << 8) / 400 + 50) >> 8; s->max_pitch_val = ((ctx->sample_rate << 8) * 37 / 2000 + 50) >> 8; pitch_range = s->max_pitch_val - s->min_pitch_val; |