[FFmpeg-cvslog] bfi: check return value of av_malloc()

Paul B Mahol git at videolan.org
Tue Jul 2 00:00:25 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Jul  1 21:37:16 2013 +0000| [51f1bf3309695b5f20d4f0e0ff90e54854c206d2] | committer: Paul B Mahol

bfi: check return value of av_malloc()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavformat/bfi.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/bfi.c b/libavformat/bfi.c
index a28e09a..7a4f436 100644
--- a/libavformat/bfi.c
+++ b/libavformat/bfi.c
@@ -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);



More information about the ffmpeg-cvslog mailing list