summaryrefslogtreecommitdiff
path: root/libavformat/asfenc.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-03-17 15:13:43 +0100
committerLuca Barbato <lu_zero@gentoo.org>2013-03-18 10:48:23 +0100
commitd1bec33b46091546c5b2e6815210e73f87abf413 (patch)
tree37887277fb43bc0cee1d25801f13b788bb78bb54 /libavformat/asfenc.c
parent6552808014ae318c8feaa8effac6ee40ea6019ce (diff)
asfenc: return error on negative timestamp
According to the specification the timestamp is represented by a 32bit unsigned. CC: libav-stable@libav.org
Diffstat (limited to 'libavformat/asfenc.c')
-rw-r--r--libavformat/asfenc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index a523b3a051..6112d3f2e0 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);