[FFmpeg-cvslog] avio: check AVIOContext malloc failure

Can Wu git at videolan.org
Sun May 22 05:14:33 CEST 2011


ffmpeg | branch: master | Can Wu <wu.canus at gmail.com> | Sat May 14 17:27:31 2011 +0800| [9e2dabed4a7bf21e3e0c0f4ddc895f8ed90fa839] | committer: Anton Khirnov

avio: check AVIOContext malloc failure

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavformat/aviobuf.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 2b14d48..fa63ddf 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -113,6 +113,8 @@ AVIOContext *avio_alloc_context(
                   int64_t (*seek)(void *opaque, int64_t offset, int whence))
 {
     AVIOContext *s = av_mallocz(sizeof(AVIOContext));
+    if (!s)
+        return NULL;
     ffio_init_context(s, buffer, buffer_size, write_flag, opaque,
                   read_packet, write_packet, seek);
     return s;



More information about the ffmpeg-cvslog mailing list