Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-05-17 00:35:58 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-14 19:55:45 +0300
commit8176799f31b23849382623f0f9001acc5edf7c76 (patch)
tree69d284dc05a41c6d2b7885d02f1fad28f774bfd1 /libavformat
parentdaf38d0753a2fdb4fc34c41735650698a9d50b36 (diff)
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5d9ffa69a3..0acf981aef 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7586,7 +7586,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)