From 0f629823355680802320ee7be52af7f4e1b3e0b3 Mon Sep 17 00:00:00 2001 From: James Almer Date: Fri, 4 Apr 2014 03:19:59 -0300 Subject: oggenc: check return value of av_mallocz() Signed-off-by: James Almer Signed-off-by: Michael Niedermayer --- libavformat/oggenc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat/oggenc.c') diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 4398b20a7c..4ba6940d10 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -427,6 +427,9 @@ static int ogg_write_header(AVFormatContext *s) return -1; } oggstream = av_mallocz(sizeof(*oggstream)); + if (!oggstream) + return AVERROR(ENOMEM); + oggstream->page.stream_index = i; if (!(st->codec->flags & CODEC_FLAG_BITEXACT)) -- cgit v1.2.3