Browse Source

avformat/mpegtsenc: check avformat_new_stream() return

Fixes CID1206645
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
66e30a2e65
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/mpegtsenc.c

+ 4
- 0
libavformat/mpegtsenc.c View File

@@ -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;


Loading…
Cancel
Save