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>
pull/89/head
Di Wu 10 years ago committed by Michael Niedermayer
parent d267a0f8c1
commit 0e406aba14
  1. 6
      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

Loading…
Cancel
Save