just memory failure check in avio_alloc_context()

Best Regards

-- 
wucan
From f6325777104b41e7b40096d339180fc69713fcf6 Mon Sep 17 00:00:00 2001
From: Can Wu <[email protected]>
Date: Sat, 14 May 2011 17:27:31 +0800
Subject: avio: check AVIOContext malloc failure

---
 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;
-- 
1.7.3.2.168.gd6b63

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to