[libav-devel] [PATCH 1/8] Checking for allocated memory in libavformat/nutdec.c

Nidhi Makhijani nidhimj22 at gmail.com
Fri Mar 28 12:11:46 CET 2014


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

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 6328549..ea8c65c 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -326,6 +326,8 @@ static int decode_main_header(NUTContext *nut)
     }
 
     nut->stream = av_mallocz(sizeof(StreamContext) * stream_count);
+    if (!nut->stream)
+      return AVERROR(ENOMEM);
     for (i = 0; i < stream_count; i++)
         avformat_new_stream(s, NULL);
 
-- 
1.8.3.2



More information about the libav-devel mailing list