1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

mpegts: Fix dead error checks

This commit is contained in:
Alex Converse 2012-03-26 15:51:59 -07:00
parent 95b192de5d
commit c9024a9fd7

View File

@ -1389,16 +1389,18 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
return; return;
clear_program(ts, h->id); clear_program(ts, h->id);
pcr_pid = get16(&p, p_end) & 0x1fff; pcr_pid = get16(&p, p_end);
if (pcr_pid < 0) if (pcr_pid < 0)
return; return;
pcr_pid &= 0x1fff;
add_pid_to_pmt(ts, h->id, pcr_pid); add_pid_to_pmt(ts, h->id, pcr_pid);
av_dlog(ts->stream, "pcr_pid=0x%x\n", pcr_pid); av_dlog(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
program_info_length = get16(&p, p_end) & 0xfff; program_info_length = get16(&p, p_end);
if (program_info_length < 0) if (program_info_length < 0)
return; return;
program_info_length &= 0xfff;
while(program_info_length >= 2) { while(program_info_length >= 2) {
uint8_t tag, len; uint8_t tag, len;
tag = get8(&p, p_end); tag = get8(&p, p_end);
@ -1436,9 +1438,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
stream_type = get8(&p, p_end); stream_type = get8(&p, p_end);
if (stream_type < 0) if (stream_type < 0)
break; break;
pid = get16(&p, p_end) & 0x1fff; pid = get16(&p, p_end);
if (pid < 0) if (pid < 0)
break; break;
pid &= 0x1fff;
/* now create stream */ /* now create stream */
if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) { if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
@ -1476,9 +1479,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
ff_program_add_stream_index(ts->stream, h->id, st->index); ff_program_add_stream_index(ts->stream, h->id, st->index);
desc_list_len = get16(&p, p_end) & 0xfff; desc_list_len = get16(&p, p_end);
if (desc_list_len < 0) if (desc_list_len < 0)
break; break;
desc_list_len &= 0xfff;
desc_list_end = p + desc_list_len; desc_list_end = p + desc_list_len;
if (desc_list_end > p_end) if (desc_list_end > p_end)
break; break;
@ -1522,9 +1526,10 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
sid = get16(&p, p_end); sid = get16(&p, p_end);
if (sid < 0) if (sid < 0)
break; break;
pmt_pid = get16(&p, p_end) & 0x1fff; pmt_pid = get16(&p, p_end);
if (pmt_pid < 0) if (pmt_pid < 0)
break; break;
pmt_pid &= 0x1fff;
av_dlog(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid); av_dlog(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
@ -1572,9 +1577,10 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
val = get8(&p, p_end); val = get8(&p, p_end);
if (val < 0) if (val < 0)
break; break;
desc_list_len = get16(&p, p_end) & 0xfff; desc_list_len = get16(&p, p_end);
if (desc_list_len < 0) if (desc_list_len < 0)
break; break;
desc_list_len &= 0xfff;
desc_list_end = p + desc_list_len; desc_list_end = p + desc_list_len;
if (desc_list_end > p_end) if (desc_list_end > p_end)
break; break;