diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-26 22:08:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-26 22:08:37 +0200 |
commit | 66e30a2e65e81a5abb9149fe8587355273cbb38f (patch) | |
tree | 0ef8e48e4fbeb5fee0a169a7a2618e0632cdf685 | |
parent | 24725f8e096bb5e7997f410bad3aadac61e5e581 (diff) | |
download | ffmpeg-66e30a2e65e81a5abb9149fe8587355273cbb38f.tar.gz |
avformat/mpegtsenc: check avformat_new_stream() return
Fixes CID1206645
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mpegtsenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 2e04ea3085..47f0a784fd 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; |