diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-05-16 23:35:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-06-18 01:16:04 +0200 |
commit | 532ba2e4ae8c6cc07a85df0719c5adb9cd57f27c (patch) | |
tree | 16a0450664b5bede9c05d384a312066731a4ae40 | |
parent | 78fe6f7c32ddca273587529ab3c517c39f6dc0d6 (diff) | |
download | ffmpeg-532ba2e4ae8c6cc07a85df0719c5adb9cd57f27c.tar.gz |
avformat/mov: Only set pkt->duration to non negative values
Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8176799f31b23849382623f0f9001acc5edf7c76)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 62746448ed..7f5f93e648 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -6654,7 +6654,9 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) } else { int64_t next_dts = (sc->current_sample < st->nb_index_entries) ? st->index_entries[sc->current_sample].timestamp : st->duration; - pkt->duration = next_dts - pkt->dts; + + if (next_dts >= pkt->dts) + pkt->duration = next_dts - pkt->dts; pkt->pts = pkt->dts; } if (st->discard == AVDISCARD_ALL) |