summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2014-03-02 18:34:48 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-05 02:28:25 +0100
commitd08bb065f2acad0f77c53dacfb25c2885d8cc864 (patch)
tree23e491b041c076342807351258bc83233a431c0c /libavformat
parent7fd64e3e36f79204c0eda7cacce6884c14ddc1fb (diff)
mpegts: use goto out instead of break on truncated or invalid pmt tables
Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpegts.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 10b33fe1dd..2a03f011e9 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1705,10 +1705,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
break;
pid = get16(&p, p_end);
if (pid < 0)
- break;
+ goto out;
pid &= 0x1fff;
if (pid == ts->current_pid)
- break;
+ goto out;
/* now create stream */
if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
@@ -1754,11 +1754,11 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
desc_list_len = get16(&p, p_end);
if (desc_list_len < 0)
- break;
+ goto out;
desc_list_len &= 0xfff;
desc_list_end = p + desc_list_len;
if (desc_list_end > p_end)
- break;
+ goto out;
for(;;) {
if (ff_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p, desc_list_end,
mp4_descr, mp4_descr_count, pid, ts) < 0)