aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-05-16 23:35:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-16 19:06:27 +0200
commit98f10ca12ccc1accafbf26d9eeb6e7c91bd650eb (patch)
treec619e55eaf9a9f2e6d9973c36482d45c5ebfb5b3
parentf4f9bd655d4254d3c9ef093efff1afbaeefbb219 (diff)
downloadffmpeg-98f10ca12ccc1accafbf26d9eeb6e7c91bd650eb.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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 66fce34f3a..f6db8a47b7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6384,7 +6384,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)