From a4d2af9b96cc5715b9dc2fecb1c56435de93e49a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Axelsson?= Date: Sun, 12 Apr 2009 02:19:40 +0000 Subject: [PATCH] =?utf8?q?Ok,=20ts=20demuxer=20is=20more=20complicated=20t?= =?utf8?q?han=20I=20thought=20Revert=20r18454=20and=20fix=20correctly=20#7?= =?utf8?q?00=20Stop=20parsing=20if=20end=20of=20buffer=20is=20reached=20wh?= =?utf8?q?ile=20reading=20patch=20by=20Bj=C3=B6rn=20Axelsson,=20bjorn=20do?= =?utf8?q?t=20axelsson=20at=20intinor=20dot=20se?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Originally committed as revision 18455 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mpegts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 7468a02..226f5b2 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; -- 2.7.4