diff options
author | Clément Bœsch <u@pkh.me> | 2014-10-10 23:49:38 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2014-10-10 23:49:38 +0200 |
commit | 937aac4f978c79ebdb2ae940b64a0f5cdb534d68 (patch) | |
tree | e34f17419f3a3d231e5f1d7ab9a447184b0ced6d /libavformat/assenc.c | |
parent | d246397161bb68f12dcb03bbd4f2d315748914fb (diff) | |
download | ffmpeg-937aac4f978c79ebdb2ae940b64a0f5cdb534d68.tar.gz |
avformat/assenc: make sure we crawl extradata only if it's non-null
Diffstat (limited to 'libavformat/assenc.c')
-rw-r--r-- | libavformat/assenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 8593b6ca4d..d495ce3a92 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -53,9 +53,9 @@ static int write_header(AVFormatContext *s) avio_write(s->pb, avctx->extradata, avctx->extradata_size); if (avctx->extradata[avctx->extradata_size - 1] != '\n') avio_write(s->pb, "\r\n", 2); + if (!strstr(avctx->extradata, "\n[Events]")) + avio_printf(s->pb, "[Events]\r\nFormat: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text\r\n"); } - if (!strstr(avctx->extradata, "\n[Events]")) - avio_printf(s->pb, "[Events]\r\nFormat: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text\r\n"); avio_flush(s->pb); return 0; |