summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2010-06-04 22:41:06 +0000
committerDavid Conrad <lessen42@gmail.com>2010-06-04 22:41:06 +0000
commitd06735a34a053160adbf1ae7f83e340c1628f2bf (patch)
tree208806966dc0eb4f83ee657c28e3fb7cfa55fb51 /libavformat/matroskaenc.c
parent1f4280e744f2f0f97d4677df336a90f290f852da (diff)
downloadffmpeg-d06735a34a053160adbf1ae7f83e340c1628f2bf.tar.gz
matroskaenc: Check that tracks was allocated
Originally committed as revision 23477 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 6166edf8e1..6bc10050c4 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -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);