summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-26 22:08:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-26 22:08:37 +0200
commit66e30a2e65e81a5abb9149fe8587355273cbb38f (patch)
tree0ef8e48e4fbeb5fee0a169a7a2618e0632cdf685 /libavformat/mpegtsenc.c
parent24725f8e096bb5e7997f410bad3aadac61e5e581 (diff)
avformat/mpegtsenc: check avformat_new_stream() return
Fixes CID1206645 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c4
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;