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

Michael Niedermayer git at videolan.org
Sat Apr 26 22:32:25 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 26 22:08:10 2014 +0200| [66e30a2e65e81a5abb9149fe8587355273cbb38f] | committer: Michael Niedermayer

avformat/mpegtsenc: check avformat_new_stream() return

Fixes CID1206645
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mpegtsenc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 2e04ea3..47f0a78 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -700,6 +700,10 @@ static int mpegts_write_header(AVFormatContext *s)
                 goto fail;
             }
             ast = avformat_new_stream(ts_st->amux, NULL);
+            if (!ast) {
+                ret = AVERROR(ENOMEM);
+                goto fail;
+            }
             ret = avcodec_copy_context(ast->codec, st->codec);
             if (ret != 0)
                 goto fail;



More information about the ffmpeg-cvslog mailing list