diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-05-02 01:46:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-06-04 18:21:25 +0200 |
commit | b1c3d81e71f78e4b3b2c2901ac4649cb74aec272 (patch) | |
tree | 7579288af17cb51e7983dd3c290de41a24384dec | |
parent | b168aeb734069b09ab174666169f9c5dd631fb1b (diff) |
avformat/oggparsetheora: clip duration within 64bit
Fixes: signed integer overflow: 9079256848778919936 - -288230376151711746 cannot be represented in type 'long'
Fixes: 58248/clusterfuzz-testcase-minimized-ffmpeg_dem_OGG_fuzzer-6326851353313280
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/oggparsetheora.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index b9184eff7b..85119352c3 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -196,7 +196,7 @@ static int theora_packet(AVFormatContext *s, int idx) if(s->streams[idx]->start_time == AV_NOPTS_VALUE && os->lastpts != AV_NOPTS_VALUE) { s->streams[idx]->start_time = os->lastpts; if (s->streams[idx]->duration > 0) - s->streams[idx]->duration -= s->streams[idx]->start_time; + s->streams[idx]->duration = av_sat_sub64(s->streams[idx]->duration, s->streams[idx]->start_time); } } |