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>
This commit is contained in:
Di Wu 2014-10-15 16:24:21 +08:00 committed by Michael Niedermayer
parent d267a0f8c1
commit 0e406aba14
1 changed files with 4 additions and 2 deletions

View File

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