summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2020-11-14 20:59:01 +0100
committerMichael Niedermayer <[email protected]>2021-09-11 21:23:48 +0200
commitb9df29a39326f965405324b1cd3034a4366a1bc1 (patch)
tree6756908df6832731d2cbfd7e39a0517099debc9d
parent5515c34baf20d9db0d81c611037f7911c86e955c (diff)
avformat/iff: Check size before skip
Fixes: Infinite loop Fixes: 27292/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5731168991051776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 8b50e8bc2975fad85e0713e05940ee9ecb5e8a18) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/iff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index dd434de2d4..643ca71dca 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -259,6 +259,9 @@ static int parse_dsd_prop(AVFormatContext *s, AVStream *st, uint64_t eof)
uint64_t size = avio_rb64(pb);
uint64_t orig_pos = avio_tell(pb);
+ if (size >= INT64_MAX)
+ return AVERROR_INVALIDDATA;
+
switch(tag) {
case MKTAG('A','B','S','S'):
if (size < 8)