[FFmpeg-cvslog] avformat/mpegenc: Fix integer overflow with AV_NOPTS_VALUE

Michael Niedermayer git at videolan.org
Thu May 21 16:33:48 EEST 2020


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Feb 16 18:51:52 2020 +0100| [ab9074c1c3fc5179f153743d869b33a7623d738b] | committer: Michael Niedermayer

avformat/mpegenc: Fix integer overflow with AV_NOPTS_VALUE

Fixes: signed integer overflow: -9223372036854775808 - 45000 cannot be represented in type 'long'
Fixes: ticket8187

Found-by: Suhwan
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9874815b1aadadd7fd19aa6aabb7d9193f2f43d5)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab9074c1c3fc5179f153743d869b33a7623d738b
---

 libavformat/mpegenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 43ebc46e0e..1b0b532790 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1215,7 +1215,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
     if (s->is_dvd) {
         // min VOBU length 0.4 seconds (mpucoder)
         if (is_iframe &&
-            (s->packet_number == 0 ||
+            (s->packet_number == 0 || pts != AV_NOPTS_VALUE &&
              (pts - stream->vobu_start_pts >= 36000))) {
             stream->bytes_to_iframe = av_fifo_size(stream->fifo);
             stream->align_iframe    = 1;



More information about the ffmpeg-cvslog mailing list