Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-20 02:07:50 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-14 00:39:50 +0300
commit86c204addfa0369d45322b9f8392ef3387cf82ee (patch)
tree2f83b55256c8880f530d030d71e21ca98d7d8321
parentadcacd0d744795b14a90b72ce5b9ba820b5074d1 (diff)
avformat/aqtitledec: Skip unrepresentable durations
Fixes: signed integer overflow: -5 - 9223372036854775807 cannot be represented in type 'long' Fixes: 45665/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-475618463934054 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 c2d1597a8a6470045a8da241d4f65c81f26c3107) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/aqtitledec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/aqtitledec.c b/libavformat/aqtitledec.c
index 317547c4f4..01b4fd7b93 100644
--- a/libavformat/aqtitledec.c
+++ b/libavformat/aqtitledec.c
@@ -74,7 +74,8 @@ static int aqt_read_header(AVFormatContext *s)
new_event = 1;
pos = avio_tell(s->pb);
if (sub) {
- sub->duration = frame - sub->pts;
+ if (frame >= sub->pts && (uint64_t)frame - sub->pts < INT64_MAX)
+ sub->duration = frame - sub->pts;
sub = NULL;
}
} else if (*line) {