aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2010-03-09 04:23:33 +0000
committerDavid Conrad <lessen42@gmail.com>2010-03-09 04:23:33 +0000
commit654b65d01229ad3016d34c4189d8b31f5981f570 (patch)
tree96babe0cd01ba162f37eae1db401c0568701d1b9
parent84d4e599a500ec829fe12d4c3ab6eca5282c3033 (diff)
downloadffmpeg-654b65d01229ad3016d34c4189d8b31f5981f570.tar.gz
mkvenc: Don't try to write packets with unknown timestamps
Originally committed as revision 22371 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/matroskaenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 1ed69b47cc..c0d4f1b32a 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -866,6 +866,11 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
int ret;
int64_t ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts;
+ if (ts == AV_NOPTS_VALUE) {
+ av_log(s, AV_LOG_ERROR, "Can't write packet with unknown timestamp\n");
+ return AVERROR(EINVAL);
+ }
+
if (url_is_streamed(s->pb)) {
if (!mkv->dyn_bc)
url_open_dyn_buf(&mkv->dyn_bc);