[FFmpeg-devel,1/4] lavf/mpegts: mark packets with TEI flag as corrupted

Submitted by Rodger Combs on Dec. 13, 2017, 11:44 a.m.

Details

Message ID 20171213114453.22089-1-rodger.combs@gmail.com
State New
Headers show

Commit Message

Rodger Combs Dec. 13, 2017, 11:44 a.m.
---
 libavformat/mpegts.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Michael Niedermayer Dec. 13, 2017, 10:04 p.m.
On Wed, Dec 13, 2017 at 05:44:50AM -0600, Rodger Combs wrote:
> ---
>  libavformat/mpegts.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 53cbcfb543..0a3ad05726 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -2296,6 +2296,14 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
>          }
>      }
>  
> +    if (packet[1] & 0x80) {
> +        av_log(ts->stream, AV_LOG_DEBUG, "Packet had TEI flag set; marking as corrupt\n");
> +        if (tss->type == MPEGTS_PES) {
> +            PESContext *pc = tss->u.pes_filter.opaque;
> +            pc->flags |= AV_PKT_FLAG_CORRUPT;
> +        }
> +    }

probably ok

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 53cbcfb543..0a3ad05726 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2296,6 +2296,14 @@  static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
         }
     }
 
+    if (packet[1] & 0x80) {
+        av_log(ts->stream, AV_LOG_DEBUG, "Packet had TEI flag set; marking as corrupt\n");
+        if (tss->type == MPEGTS_PES) {
+            PESContext *pc = tss->u.pes_filter.opaque;
+            pc->flags |= AV_PKT_FLAG_CORRUPT;
+        }
+    }
+
     p = packet + 4;
     if (has_adaptation) {
         int64_t pcr_h;