diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index a825c0f7c7..8abe07df61 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -68,7 +68,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 {