Commit 66e30a2e authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mpegtsenc: check avformat_new_stream() return

Fixes CID1206645
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 24725f8e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment