oggenc: check return value of av_mallocz()
authorJames Almer <jamrial@gmail.com>
Fri, 4 Apr 2014 06:19:59 +0000 (03:19 -0300)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Apr 2014 13:56:52 +0000 (15:56 +0200)
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggenc.c

index 4398b20..4ba6940 100644 (file)
@@ -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))