mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
libavformat/iff: Check for overflow in body_end calculation
Fixes: signed integer overflow: -6322983228386819992 - 5557477266266529857 cannot be represented in type 'long'
Fixes: 50112/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6329186221948928
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 bcb4690304
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
09647fc78c
commit
a87ad0dba0
@ -435,6 +435,9 @@ static int iff_read_header(AVFormatContext *s)
|
||||
case ID_DSD:
|
||||
case ID_MDAT:
|
||||
iff->body_pos = avio_tell(pb);
|
||||
if (iff->body_pos < 0 || iff->body_pos + data_size > INT64_MAX)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
iff->body_end = iff->body_pos + data_size;
|
||||
iff->body_size = data_size;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user