Commit d06735a3 authored by David Conrad's avatar David Conrad

matroskaenc: Check that tracks was allocated

Originally committed as revision 23477 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 1f4280e7
...@@ -703,6 +703,8 @@ static int mkv_write_header(AVFormatContext *s) ...@@ -703,6 +703,8 @@ static int mkv_write_header(AVFormatContext *s)
av_lfg_init(&mkv->lfg, av_get_random_seed()); av_lfg_init(&mkv->lfg, av_get_random_seed());
mkv->tracks = av_mallocz(s->nb_streams * sizeof(*mkv->tracks)); mkv->tracks = av_mallocz(s->nb_streams * sizeof(*mkv->tracks));
if (!mkv->tracks)
return AVERROR(ENOMEM);
ebml_header = start_ebml_master(pb, EBML_ID_HEADER, 0); ebml_header = start_ebml_master(pb, EBML_ID_HEADER, 0);
put_ebml_uint (pb, EBML_ID_EBMLVERSION , 1); put_ebml_uint (pb, EBML_ID_EBMLVERSION , 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment