diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-26 20:55:31 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-09 22:02:19 +0200 |
commit | 10cfdf25afd21bca6b001856e5c1381bafdcd232 (patch) | |
tree | 1fd9aa4bb0a7b1508bca0232f5b2ef1bbe931e68 | |
parent | f1f6d6c861241b35a9fd1b7fea5526d807571c70 (diff) | |
download | ffmpeg-10cfdf25afd21bca6b001856e5c1381bafdcd232.tar.gz |
avformat/aiffdec: Check packet size
Fixes: Fixes infinite loop
Fixes: 26575/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5727522236661760
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0ba71a72d3a617b255b71988a000d5093222f779)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/aiffdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 59e969d12d..925486c021 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -386,6 +386,8 @@ static int aiff_read_packet(AVFormatContext *s, break; default: size = st->codecpar->block_align ? (MAX_SIZE / st->codecpar->block_align) * st->codecpar->block_align : MAX_SIZE; + if (!size) + return AVERROR_INVALIDDATA; } size = FFMIN(max_size, size); res = av_get_packet(s->pb, pkt, size); |