summaryrefslogtreecommitdiff
path: root/libavformat/oggenc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-04-04 03:19:59 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-04-04 15:56:52 +0200
commit0f629823355680802320ee7be52af7f4e1b3e0b3 (patch)
treece743e37122df316de564e9f0a374c2754727a6d /libavformat/oggenc.c
parent35617366b581da3e4bbd0557a8fa164ba8406968 (diff)
oggenc: check return value of av_mallocz()
Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggenc.c')
-rw-r--r--libavformat/oggenc.c3
1 files changed, 3 insertions, 0 deletions
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))