aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dstdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-02-13 20:56:56 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-03 12:10:24 +0200
commitf65d68abd966f4c59f31cdcf042cef2c98a619a9 (patch)
tree47506a9256643f26216fe7b24ea7fd42642890d3 /libavcodec/dstdec.c
parent5cdbb2a977964f879cd059c903cee611b8fbcc6f (diff)
downloadffmpeg-f65d68abd966f4c59f31cdcf042cef2c98a619a9.tar.gz
avcodec/dstdec: Check sample rate
Fixes: out of array access Fixes: 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5735812071424000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5727b1f13f36c4db30d5d0de51640f740edf01e8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dstdec.c')
-rw-r--r--libavcodec/dstdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index b70e0d27ec..d8f80bd114 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -85,6 +85,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_PATCHWELCOME;
}
+ if (DST_SAMPLES_PER_FRAME(avctx->sample_rate) & 7) {
+ return AVERROR_PATCHWELCOME;
+ }
+
avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
for (i = 0; i < avctx->channels; i++)