[FFmpeg-cvslog] avformat/movenc: Check that packet duration is valid in ff_mov_write_packet()

Michael Niedermayer git at videolan.org
Fri May 23 05:10:17 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 23 03:59:32 2014 +0200| [744df0a0319c82cf0da8fdb167255516853f1238] | committer: Michael Niedermayer

avformat/movenc: Check that packet duration is valid in ff_mov_write_packet()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=744df0a0319c82cf0da8fdb167255516853f1238
---

 libavformat/movenc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 12111cb..25c462d 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;



More information about the ffmpeg-cvslog mailing list