[FFmpeg-cvslog] mpegts: prevent freeing ones own section in pat_cb

Michael Niedermayer git at videolan.org
Tue Nov 13 21:57:32 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov 13 19:48:03 2012 +0100| [eab022d863c8505ce7786c82f0e0c3a8f4eeb4bd] | committer: Michael Niedermayer

mpegts: prevent freeing ones own section in pat_cb

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eab022d863c8505ce7786c82f0e0c3a8f4eeb4bd
---

 libavformat/mpegts.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 946e31a..9e3f342 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1594,6 +1594,9 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
             break;
         pmt_pid &= 0x1fff;
 
+        if (pmt_pid == ts->current_pid)
+            break;
+
         av_dlog(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
 
         if (sid == 0x0000) {



More information about the ffmpeg-cvslog mailing list