[FFmpeg-devel] [PATCH] oggenc: check return value of av_mallocz()

James Almer jamrial at gmail.com
Fri Apr 4 08:19:59 CEST 2014


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/oggenc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 4398b20..4ba6940 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))
-- 
1.8.3.2



More information about the ffmpeg-devel mailing list