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

pull/89/head
Clément Bœsch 10 years ago
parent d246397161
commit 937aac4f97
  1. 4
      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;

Loading…
Cancel
Save