aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-26 20:55:31 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-11-04 23:30:53 +0100
commit0ba71a72d3a617b255b71988a000d5093222f779 (patch)
tree51c125f24b8bd9d2afbaf9efd568da3ed0889bd8
parent66ca6d0fe8baf1453caaa5761fc0572665a75e78 (diff)
downloadffmpeg-0ba71a72d3a617b255b71988a000d5093222f779.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>
-rw-r--r--libavformat/aiffdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index c650e9074d..15733478e1 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -406,6 +406,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);