1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avformat/wavdec: Consider AV_INPUT_BUFFER_PADDING_SIZE in set_spdif()

The buffer is read by using the bit reader
Fixes: out of array read
Fixes: 27539/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-5650565572591616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-11-24 00:22:39 +01:00
parent a8fe78decd
commit 0a7c648e2d

View File

@ -71,7 +71,7 @@ static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav)
int ret = ffio_ensure_seekback(s->pb, len);
if (ret >= 0) {
uint8_t *buf = av_malloc(len);
uint8_t *buf = av_malloc(len + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buf) {
ret = AVERROR(ENOMEM);
} else {