aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/iff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-27 21:51:08 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-02 14:18:21 +0100
commit4a6325c69ca2200f02ab7d0b4efaa8df46c60f9e (patch)
treece9389e3b51d96eddbf65cd8d675ba3aa52e8266 /libavformat/iff.c
parent4f0bdff292391cdb96b79b08c56533029166bdc8 (diff)
downloadffmpeg-4a6325c69ca2200f02ab7d0b4efaa8df46c60f9e.tar.gz
avformat/iff: check size against INT64_MAX
Bigger sizes are misinterpreted as negative numbers by the API Fixes: infinite loop Fixes: 26611/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4890614975692800 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 f291cd681b1235e150464ad83974d60d6879b492) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/iff.c')
-rw-r--r--libavformat/iff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index fb76aed4c3..a70184f105 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -223,6 +223,9 @@ static int parse_dsd_diin(AVFormatContext *s, AVStream *st, uint64_t eof)
uint64_t orig_pos = avio_tell(pb);
const char * metadata_tag = NULL;
+ if (size >= INT64_MAX)
+ return AVERROR_INVALIDDATA;
+
switch(tag) {
case MKTAG('D','I','A','R'): metadata_tag = "artist"; break;
case MKTAG('D','I','T','I'): metadata_tag = "title"; break;