This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 7516bf24db libavformat/mpegts.c: pat_cb(): Ensure all PIDs are valid
7516bf24db is described below

commit 7516bf24dba8b66e1463208dd21ba0f20293017a
Author:     Scott Theisen <[email protected]>
AuthorDate: Mon Jun 30 00:21:45 2025 -0400
Commit:     Marton Balint <[email protected]>
CommitDate: Mon Mar 23 19:50:13 2026 +0000

    libavformat/mpegts.c: pat_cb(): Ensure all PIDs are valid
    
    but just ignore invalid PAT entries so subsequent valid
    entries are parsed.
    
    ISO/IEC 13818-1:2021 specifies a valid range of [0x0010, 0x1FFE] in
    § 2.4.4.6 Semantic definition of fields in program association section
    and Table 2-3 – PID table
    
    ts->current_pid is always 0 since that is the PID for the PAT.
---
 libavformat/mpegts.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 4b326d309b..6f58e52e70 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2787,8 +2787,11 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
             break;
         pmt_pid &= 0x1fff;
 
-        if (pmt_pid == ts->current_pid)
-            break;
+        if (pmt_pid <= 0x000F || pmt_pid == 0x1FFF) {
+            av_log(ts->stream, AV_LOG_WARNING,
+                   "Ignoring invalid PAT entry: sid=0x%x pid=0x%x\n", sid, 
pmt_pid);
+            continue;
+        }
 
         av_log(ts->stream, AV_LOG_TRACE, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to