changeset 6089:dc2a1fafef8b libavformat

matroskaenc: Check that tracks was allocated
author conrad
date Fri, 04 Jun 2010 22:41:06 +0000
parents 1299f202ffe9
children b260ede399be
files matroskaenc.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/matroskaenc.c	Fri Jun 04 22:41:03 2010 +0000
+++ b/matroskaenc.c	Fri Jun 04 22:41:06 2010 +0000
@@ -703,6 +703,8 @@
     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);