From: bcoudurier Date: Sun, 12 Apr 2009 02:19:40 +0000 (+0000) Subject: Ok, ts demuxer is more complicated than I thought X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/ffmpeg.git/commitdiff_plain/3cbdbe167715c015fd0c1e3a3a5b5e9ebdf42f2c Ok, ts demuxer is more complicated than I thought Revert r18454 and fix correctly #700 Stop parsing if end of buffer is reached while reading patch by Björn Axelsson, bjorn dot axelsson at intinor dot se git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18455 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 7468a023d..226f5b28c 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -555,7 +555,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (desc_list_len < 0) break; desc_list_end = p + desc_list_len; - if (desc_list_end >= p_end) + if (desc_list_end > p_end) break; for(;;) { desc_tag = get8(&p, desc_list_end); @@ -571,6 +571,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len } } desc_len = get8(&p, desc_list_end); + if (desc_len < 0) + break; desc_end = p + desc_len; if (desc_end > desc_list_end) break;