[FFmpeg-cvslog] avformat/mov: Use 64bit in intermediate for current_dts
Michael Niedermayer
git at videolan.org
Thu Jun 13 23:42:22 EEST 2024
ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun 3 03:17:27 2024 +0200| [14aff02a1040e75f159fab5b833dec39c639bdbf] | committer: Michael Niedermayer
avformat/mov: Use 64bit in intermediate for current_dts
Fixes: CID1500304 Unintentional integer overflow
Fixes: CID1500318 Unintentional integer overflow
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 0c977d37aad609f6ed7d148c012da8bc83df8f0b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14aff02a1040e75f159fab5b833dec39c639bdbf
---
libavformat/mov.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 976c552e9b..9e87cfb387 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3043,12 +3043,12 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
corrected_dts += sample_duration * sample_count;
}
- current_dts += sc->stts_data[i].duration * sample_count;
+ current_dts += sc->stts_data[i].duration * (int64_t)sample_count;
if (current_dts > corrected_dts) {
int64_t drift = (current_dts - corrected_dts)/FFMAX(sample_count, 1);
uint32_t correction = (sc->stts_data[i].duration > drift) ? drift : sc->stts_data[i].duration - 1;
- current_dts -= correction * sample_count;
+ current_dts -= correction * (uint64_t)sample_count;
sc->stts_data[i].duration -= correction;
}
More information about the ffmpeg-cvslog
mailing list