diff --git a/libavformat/aiff.c b/libavformat/aiff.c index 7ff75b6e30..1685a306b1 100644 --- a/libavformat/aiff.c +++ b/libavformat/aiff.c @@ -368,6 +368,8 @@ static int aiff_read_header(AVFormatContext *s, url_fskip(pb, size - 8); break; case MKTAG('w', 'a', 'v', 'e'): + if ((uint64_t)size > (1<<30)) + return -1; st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM);