mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
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 f291cd681b
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6a0921a75a
commit
9d6c492479
@ -215,6 +215,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;
|
||||
|
Loading…
Reference in New Issue
Block a user