From 4b6be54bed27eb7fc8f005505ff38e71b3c86cec Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 1 May 2015 02:13:26 +0200
Subject: [PATCH] avformat/mpegts: reset last_ver on corrupted packets

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavformat/mpegts.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index d707cc31ad6..5100f374fe9 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -426,8 +426,11 @@ static void write_section_data(MpegTSContext *ts, MpegTSFilter *tss1,
             }else
                 crc_valid = 2;
         }
-        if (crc_valid)
+        if (crc_valid) {
             tss->section_cb(tss1, tss->section_buf, tss->section_h_size);
+            if (crc_valid != 1)
+                tss->last_ver = -1;
+        }
     }
 }
 
-- 
GitLab