Browse Source

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 c95857a423)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.8.16
Michael Niedermayer 6 years ago
parent
commit
561aefbf8a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/ffwavesynth.c

+ 1
- 1
libavcodec/ffwavesynth.c View File

@@ -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);


Loading…
Cancel
Save