diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-14 20:59:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-09 13:53:29 +0200 |
commit | 71411669cd5f4f2c21e7821eec8ac0e2263ac255 (patch) | |
tree | c0791e88089f930d1121cc9e8440492dbf0a1f92 | |
parent | 680f50938f22384bc33c19dfb401c8a87421c17f (diff) | |
download | ffmpeg-71411669cd5f4f2c21e7821eec8ac0e2263ac255.tar.gz |
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 <michael@niedermayer.cc>
(cherry picked from commit 8b50e8bc2975fad85e0713e05940ee9ecb5e8a18)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/iff.c | 3 |
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) |