bfi: check return value of av_malloc()
authorPaul B Mahol <onemda@gmail.com>
Mon, 1 Jul 2013 21:37:16 +0000 (21:37 +0000)
committerPaul B Mahol <onemda@gmail.com>
Mon, 1 Jul 2013 21:37:16 +0000 (21:37 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/bfi.c

index a28e09a..7a4f436 100644 (file)
@@ -81,6 +81,8 @@ static int bfi_read_header(AVFormatContext * s)
     /*Load the palette to extradata */
     avio_skip(pb, 8);
     vstream->codec->extradata      = av_malloc(768);
+    if (!vstream->codec->extradata)
+        return AVERROR(ENOMEM);
     vstream->codec->extradata_size = 768;
     avio_read(pb, vstream->codec->extradata,
                vstream->codec->extradata_size);