aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-07-15 00:35:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-14 23:30:38 +0100
commit68ee6f4d8b75bd535257ff601229b8fb70f47680 (patch)
treee9eb89ef95022904288c891f813515e0dc074135 /libavcodec
parent190b92359bb2b2d259b57655d56087a88b14c27e (diff)
downloadffmpeg-68ee6f4d8b75bd535257ff601229b8fb70f47680.tar.gz
avcodec/ffwavesynth: Check sample rate before use
Fixes: division by zero Fixes: 15725/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5641231956180992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c95857a4237d7a0c55378a44f51d2d809f3bc8f5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ffwavesynth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c
index 793eada7a5..1dbfaa5847 100644
--- a/libavcodec/ffwavesynth.c
+++ b/libavcodec/ffwavesynth.c
@@ -270,7 +270,7 @@ static int wavesynth_parse_extradata(AVCodecContext *avc)
dt = in->ts_end - in->ts_start;
switch (in->type) {
case WS_SINE:
- if (edata_end - edata < 20)
+ if (edata_end - edata < 20 || avc->sample_rate <= 0)
return AVERROR(EINVAL);
f1 = AV_RL32(edata + 0);
f2 = AV_RL32(edata + 4);