Skip to content

Commit

Permalink
avformat/mpegtsenc: check avformat_new_stream() return
Browse files Browse the repository at this point in the history
Fixes CID1206645
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 26, 2014
1 parent 24725f8 commit 66e30a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libavformat/mpegtsenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 66e30a2

Please sign in to comment.