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

James Almer git at videolan.org
Fri Apr 4 16:49:53 CEST 2014


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Apr  4 03:19:59 2014 -0300| [0f629823355680802320ee7be52af7f4e1b3e0b3] | committer: Michael Niedermayer

oggenc: check return value of av_mallocz()

Signed-off-by: James Almer <jamrial at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f629823355680802320ee7be52af7f4e1b3e0b3
---

 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))



More information about the ffmpeg-cvslog mailing list