summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-23 03:59:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-23 04:00:29 +0200
commit744df0a0319c82cf0da8fdb167255516853f1238 (patch)
treec559b9be9744c07ae1fe166b28445e97392d7748
parent1d36defe94c7d7ebf995d4dbb4f878d06272f9c6 (diff)
avformat/movenc: Check that packet duration is valid in ff_mov_write_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/movenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 12111cb86e..25c462d9c9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3333,6 +3333,10 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
pkt->dts = trk->cluster[trk->entry - 1].dts + 1;
pkt->pts = AV_NOPTS_VALUE;
}
+ if (pkt->duration < 0) {
+ av_log(s, AV_LOG_ERROR, "Application provided duration: %d is invalid\n", pkt->duration);
+ return AVERROR(EINVAL);
+ }
}
if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
int ret;