[FFmpeg-cvslog] avformat/assenc: make sure we crawl extradata only if it's non-null

Clément Bœsch git at videolan.org
Fri Oct 10 23:50:59 CEST 2014


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Fri Oct 10 23:49:38 2014 +0200| [937aac4f978c79ebdb2ae940b64a0f5cdb534d68] | committer: Clément Bœsch

avformat/assenc: make sure we crawl extradata only if it's non-null

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

 libavformat/assenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/assenc.c b/libavformat/assenc.c
index 8593b6c..d495ce3 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;



More information about the ffmpeg-cvslog mailing list