diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-23 22:32:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:44 +0100 |
commit | d05aa7459f7ed3cc414957c254bab4505d2dae91 (patch) | |
tree | 93ca57412a6267b54d8ac1b9e9b880557ad378af | |
parent | dfa089ccb3c6c39f8fb0a29637282ed8ce0c2581 (diff) | |
download | ffmpeg-d05aa7459f7ed3cc414957c254bab4505d2dae91.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 444e303b0d..44cfc3bc61 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -433,6 +433,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; |