aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-26 20:55:31 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:19 +0200
commit10cfdf25afd21bca6b001856e5c1381bafdcd232 (patch)
tree1fd9aa4bb0a7b1508bca0232f5b2ef1bbe931e68
parentf1f6d6c861241b35a9fd1b7fea5526d807571c70 (diff)
downloadffmpeg-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.c2
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);