diff options
author | Di Wu <di1028.wu@samsung.com> | 2014-10-15 16:24:21 +0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-16 04:21:21 +0200 |
commit | 0e406aba14a89e94b31afde02b6bc0f456b113f5 (patch) | |
tree | 7e38bd21f1c9ab2437d86c142a44e8d224acd03c /libavformat/mpegts.c | |
parent | d267a0f8c1a8f950abe0043dc7b9b29835ed1dc2 (diff) | |
download | ffmpeg-0e406aba14a89e94b31afde02b6bc0f456b113f5.tar.gz |
mpegts: add the judgement if a new program is created successfully
Add the judement after create a new program to avoid segment fault.
Signed-off-by: Di Wu <di1028.wu@samsung.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r-- | libavformat/mpegts.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 88082692b1..cc0ce790f0 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1925,8 +1925,10 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len } else { MpegTSFilter *fil = ts->pids[pmt_pid]; program = av_new_program(ts->stream, sid); - program->program_num = sid; - program->pmt_pid = pmt_pid; + if (program) { + program->program_num = sid; + program->pmt_pid = pmt_pid; + } if (fil) if ( fil->type != MPEGTS_SECTION || fil->pid != pmt_pid |