matroskaenc: Check that tracks was allocated

Originally committed as revision 23477 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
David Conrad 2010-06-04 22:41:06 +00:00
parent 1f4280e744
commit d06735a34a
1 changed files with 2 additions and 0 deletions

View File

@ -703,6 +703,8 @@ static int mkv_write_header(AVFormatContext *s)
av_lfg_init(&mkv->lfg, av_get_random_seed());
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);
put_ebml_uint (pb, EBML_ID_EBMLVERSION , 1);