summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
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);