aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-02-16 18:51:52 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-05 12:43:08 +0200
commit40a039fee49d109f48dcee0b4ea7306aa4fc374d (patch)
treedb076de917f3b18885de23bcb29c33b94119c46f
parent104e38464bffb9e0a329fd399b08e7e13f79ff6e (diff)
downloadffmpeg-40a039fee49d109f48dcee0b4ea7306aa4fc374d.tar.gz
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@niedermayer.cc> (cherry picked from commit 9874815b1aadadd7fd19aa6aabb7d9193f2f43d5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mpegenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index b3ee2a09b9..9061a643aa 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1155,7 +1155,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;