[FFmpeg-cvslog] bink demuxer: check malloc return value

Anton Khirnov git at videolan.org
Fri Feb 1 14:29:12 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Jan 31 21:02:06 2013 +0100| [1730ca2eca42974af0c29f38a0770997cba2f0da] | committer: Anton Khirnov

bink demuxer: check malloc return value

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

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

diff --git a/libavformat/bink.c b/libavformat/bink.c
index 5d3de14..62c377d 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -116,6 +116,8 @@ static int read_header(AVFormatContext *s)
     vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     vst->codec->codec_id   = AV_CODEC_ID_BINKVIDEO;
     vst->codec->extradata  = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
+    if (!vst->codec->extradata)
+        return AVERROR(ENOMEM);
     vst->codec->extradata_size = 4;
     avio_read(pb, vst->codec->extradata, 4);
 



More information about the ffmpeg-cvslog mailing list