diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 2048ad868a..99f9a72d1d 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2003,6 +2003,8 @@ static int mpegts_read_header(AVFormatContext *s) int len; int64_t pos; + ffio_ensure_seekback(pb, s->probesize); + /* read the first 8192 bytes to get packet size */ pos = avio_tell(pb); len = avio_read(pb, buf, sizeof(buf));