[FFmpeg-cvslog] avformat/movenc: Check that cts fits in 32bit
Michael Niedermayer
git at videolan.org
Mon Apr 15 00:00:27 EEST 2024
ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sat Mar 30 19:51:43 2024 +0100| [bfd0d096370e2464f3f0e081eeddc491900b53be] | committer: Michael Niedermayer
avformat/movenc: Check that cts fits in 32bit
Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, track->timescale, AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694
Fixes: poc2
Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit d88c284c18bf6cd3dd24a7c86b5e496dd3037405)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfd0d096370e2464f3f0e081eeddc491900b53be
---
libavformat/movenc.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b5c1c99a53..926b8e15ff 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5038,6 +5038,12 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0)
return ret;
+ if (pkt->pts != AV_NOPTS_VALUE &&
+ (uint64_t)pkt->dts - pkt->pts != (int32_t)((uint64_t)pkt->dts - pkt->pts)) {
+ av_log(s, AV_LOG_WARNING, "pts/dts pair unsupported\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
int ret;
if (mov->moov_written || mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {
More information about the ffmpeg-cvslog
mailing list