[FFmpeg-devel] [PATCH 3/5] mpegts: use goto out instead of break on truncated or invalid pmt tables

Marton Balint cus at passwd.hu
Sun Mar 2 18:34:48 CET 2014


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/mpegts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 0dcd64a..a0b253d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1699,10 +1699,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) {
@@ -1748,11 +1748,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)
-- 
1.8.4.5



More information about the ffmpeg-devel mailing list