diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-15 00:35:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-14 23:30:38 +0100 |
commit | 2d86e41d450c00956cc2d3fcedcd00a9d41e1005 (patch) | |
tree | 888b94a3d1a59ea257cb823a2a47f1e9640ec36f /libavcodec | |
parent | 6e1b07c0b29b532656dc42c0e6d5fbf426502610 (diff) | |
download | ffmpeg-2d86e41d450c00956cc2d3fcedcd00a9d41e1005.tar.gz |
avcodec/ffwavesynth: Check if there is enough extradata before allocation
Fixes: OOM
Fixes: 15750/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5702090367696896
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 65bac4a7825e1f2bbf4112569ffa363cc1fdbce5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ffwavesynth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c index 94a843e3ca..b319b3341a 100644 --- a/libavcodec/ffwavesynth.c +++ b/libavcodec/ffwavesynth.c @@ -247,7 +247,7 @@ static int wavesynth_parse_extradata(AVCodecContext *avc) edata_end = edata + avc->extradata_size; ws->nb_inter = AV_RL32(edata); edata += 4; - if (ws->nb_inter < 0) + if (ws->nb_inter < 0 || (edata_end - edata) / 24 < ws->nb_inter) return AVERROR(EINVAL); ws->inter = av_calloc(ws->nb_inter, sizeof(*ws->inter)); if (!ws->inter) |