[FFmpeg-cvslog] avformat/libnut: check avformat_new_stream() return value

Paul B Mahol git at videolan.org
Wed Sep 11 13:13:41 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Sep 11 10:14:01 2013 +0000| [848ad8db2208cccfd671f1362a0b2c7a91ee1541] | committer: Paul B Mahol

avformat/libnut: check avformat_new_stream() return value

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

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

 libavformat/libnut.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/libnut.c b/libavformat/libnut.c
index 838c55a..7147998 100644
--- a/libavformat/libnut.c
+++ b/libavformat/libnut.c
@@ -223,6 +223,9 @@ static int nut_read_header(AVFormatContext * avf) {
         AVStream * st = avformat_new_stream(avf, NULL);
         int j;
 
+        if (!st)
+            return AVERROR(ENOMEM);
+
         for (j = 0; j < s[i].fourcc_len && j < 8; j++) st->codec->codec_tag |= s[i].fourcc[j]<<(j*8);
 
         st->codec->has_b_frames = s[i].decode_delay;



More information about the ffmpeg-cvslog mailing list