Commit 9874815b authored by Michael Niedermayer's avatar 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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 31f956ac
...@@ -1210,7 +1210,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) ...@@ -1210,7 +1210,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
if (s->is_dvd) { if (s->is_dvd) {
// min VOBU length 0.4 seconds (mpucoder) // min VOBU length 0.4 seconds (mpucoder)
if (is_iframe && if (is_iframe &&
(s->packet_number == 0 || (s->packet_number == 0 || pts != AV_NOPTS_VALUE &&
(pts - stream->vobu_start_pts >= 36000))) { (pts - stream->vobu_start_pts >= 36000))) {
stream->bytes_to_iframe = av_fifo_size(stream->fifo); stream->bytes_to_iframe = av_fifo_size(stream->fifo);
stream->align_iframe = 1; stream->align_iframe = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment