Browse Source

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

tags/n2.5
Clément Bœsch 11 years ago
parent
commit
937aac4f97
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/assenc.c

+ 2
- 2
libavformat/assenc.c View File

@@ -53,9 +53,9 @@ static int write_header(AVFormatContext *s)
avio_write(s->pb, avctx->extradata, avctx->extradata_size); avio_write(s->pb, avctx->extradata, avctx->extradata_size);
if (avctx->extradata[avctx->extradata_size - 1] != '\n') if (avctx->extradata[avctx->extradata_size - 1] != '\n')
avio_write(s->pb, "\r\n", 2); 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); avio_flush(s->pb);


return 0; return 0;


Loading…
Cancel
Save