aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-08 22:52:56 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit7549beb2a272cc81d3228c337cd03b1498a78e77 (patch)
treed7d42abba46d0413bb56191663e3acfcd75b83d1
parente7f409662cca18e7ee9108e0bd0867ba50f59de5 (diff)
downloadffmpeg-7549beb2a272cc81d3228c337cd03b1498a78e77.tar.gz
avcodec/aacdec_template: Check samplerate
Fixes: signed integer overflow: 2 * 1881153568 cannot be represented in type 'int' Fixes: 17996/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5687126468853760 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 7730bacb413fcb59f30acef0b2c6d50c5e6382d6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/aacdec_template.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index a0d457f8d0..1849104ff8 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -1118,6 +1118,9 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
AACContext *ac = avctx->priv_data;
int ret;
+ if (avctx->sample_rate > 96000)
+ return AVERROR_INVALIDDATA;
+
ret = ff_thread_once(&aac_table_init, &aac_static_table_init);
if (ret != 0)
return AVERROR_UNKNOWN;