1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avformat/asfdec_f: Saturate presentation time in marker

Fixes: signed integer overflow: -9223372036315799520 - 3873890816 cannot be represented in type 'long'
Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5009302746431488

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 cedb4736f5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-10-01 00:00:28 +02:00
parent 29788ba10e
commit a563efcfda
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -670,7 +670,7 @@ static int asf_read_marker(AVFormatContext *s)
avio_rl64(pb); // offset, 8 bytes
pres_time = avio_rl64(pb); // presentation time
pres_time -= asf->hdr.preroll * 10000;
pres_time = av_sat_sub64(pres_time, asf->hdr.preroll * 10000);
avio_rl16(pb); // entry length
avio_rl32(pb); // send time
avio_rl32(pb); // flags