Browse Source

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>
(cherry picked from commit 0a7c648e2d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3.2
Michael Niedermayer 5 years ago
parent
commit
8a88150ffc
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/wavdec.c

+ 1
- 1
libavformat/wavdec.c View File

@@ -69,7 +69,7 @@ static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav)
int ret = ffio_ensure_seekback(s->pb, len); int ret = ffio_ensure_seekback(s->pb, len);


if (ret >= 0) { if (ret >= 0) {
uint8_t *buf = av_malloc(len);
uint8_t *buf = av_malloc(len + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buf) { if (!buf) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
} else { } else {


Loading…
Cancel
Save