diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 0758152b3a..424ab38963 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1649,7 +1649,7 @@ static int mp4_read_iods(AVFormatContext *s, const uint8_t *buf, unsigned size, ret = parse_mp4_descr(&d, avio_tell(&d.pb), size, MP4IODescrTag); - *descr_count = d.descr_count; + *descr_count += d.descr_count; return ret; } @@ -2355,7 +2355,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len get8(&p, p_end); // label len -= 2; mp4_read_iods(ts->stream, p, len, mp4_descr + mp4_descr_count, - &mp4_descr_count, MAX_MP4_DESCR_COUNT); + &mp4_descr_count, MAX_MP4_DESCR_COUNT - mp4_descr_count); } else if (tag == REGISTRATION_DESCRIPTOR && len >= 4) { prog_reg_desc = bytestream_get_le32(&p); len -= 4;