summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpegts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index ed918cb356..da8eee2414 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2355,10 +2355,11 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
av_log(ts->stream, AV_LOG_TRACE, "program tag: 0x%02x len=%d\n", tag, len);
- if (len > program_info_length - 2)
+ program_info_length -= 2;
+ if (len > program_info_length)
// something else is broken, exit the program_descriptors_loop
break;
- program_info_length -= len + 2;
+ program_info_length -= len;
if (tag == IOD_DESCRIPTOR) {
get8(&p, p_end); // scope
get8(&p, p_end); // label