ogg: check memory allocations
authorFederico Tomassetti <f.tomassetti@gmail.com>
Sat, 14 Feb 2015 16:14:51 +0000 (16:14 +0000)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 15 Feb 2015 17:20:54 +0000 (18:20 +0100)
Bug-Id: CID 1257795
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/oggenc.c

index 70c7817..8f8a08f 100644 (file)
@@ -444,6 +444,8 @@ 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 (!(s->flags & AVFMT_FLAG_BITEXACT))