aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-09-09 13:11:43 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-09-28 17:11:52 +0200
commitb7b3b0086d4e87caa2f8a54d472e20c80ce23369 (patch)
tree8129ace2e8ef56e04355f48660e5ec79e8a7b646 /libavformat
parentd669b7f4f6e8bfe4db5501c7f1d95bdae84f1f1f (diff)
downloadffmpeg-b7b3b0086d4e87caa2f8a54d472e20c80ce23369.tar.gz
avformat/movenc: Check first DTS similar to dts difference
Fixes assertion failure Fixes: b84b53855a0b74560e64c6f45f505a13/signal_sigabrt_7ffff6ae7c37_3837_ef4e243ea5b4fa8d0becf4afe9166604.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 68f4c2163ec6d4534ae1756dbcf259845f2e4d2c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b9c0f7ae67..4e51cdf66f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4362,6 +4362,13 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
pkt->dts = trk->cluster[trk->entry - 1].dts + 1;
pkt->pts = AV_NOPTS_VALUE;
}
+ } else if (pkt->dts <= INT_MIN || pkt->dts >= INT_MAX) {
+ av_log(s, AV_LOG_ERROR, "Application provided initial timestamp: %"PRId64" is out of range for mov/mp4 format\n",
+ pkt->dts
+ );
+
+ pkt->dts = 0;
+ pkt->pts = AV_NOPTS_VALUE;
}
if (pkt->duration < 0 || pkt->duration > INT_MAX) {
av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is invalid\n", pkt->duration);