[FFmpeg-cvslog] asfenc: return error on negative timestamp

Luca Barbato git at videolan.org
Mon Mar 18 17:35:33 CET 2013


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sun Mar 17 15:13:43 2013 +0100| [d1bec33b46091546c5b2e6815210e73f87abf413] | committer: Luca Barbato

asfenc: return error on negative timestamp

According to the specification the timestamp is represented by a 32bit
unsigned.

CC: libav-stable at libav.org

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

 libavformat/asfenc.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index a523b3a..6112d3f 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -774,6 +774,14 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
         flags &= ~AV_PKT_FLAG_KEY;
 
     pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
+
+    if (pts < 0) {
+        av_log(s, AV_LOG_ERROR,
+               "Negative dts not supported stream %d, dts %"PRId64"\n",
+               pkt->stream_index, pts);
+        return AVERROR(ENOSYS);
+    }
+
     assert(pts != AV_NOPTS_VALUE);
     duration      = pts * 10000;
     asf->duration = FFMAX(asf->duration, duration + pkt->duration * 10000);



More information about the ffmpeg-cvslog mailing list