summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-23 22:32:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-09 17:27:20 +0100
commit55c97a763783540ee48a326a3e82fbdea42f8280 (patch)
tree2588e3dba793aadcd0d2fae5c741e743e01c513a /libavcodec
parent9ea997395909907f569787d4ba5b96352ad31a80 (diff)
downloadffmpeg-streaming-55c97a763783540ee48a326a3e82fbdea42f8280.zip
ffmpeg-streaming-55c97a763783540ee48a326a3e82fbdea42f8280.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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmavoice.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 68bb659..4c147fe 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;
OpenPOWER on IntegriCloud