Skip to content

Commit 6c4e56f

Browse files
committed
libavformat/hls: Be more restrictive on mpegts extensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 0113e30) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 880007e commit 6c4e56f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libavformat/hls.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,10 @@ static int test_segment(AVFormatContext *s, const AVInputFormat *in_fmt, struct
758758
matchF |= av_match_ext( seg->url, "ts")
759759
+ 2*(ff_match_url_ext(seg->url, "ts") > 0);
760760
}
761-
} else if (!strcmp(in_fmt->name, "mpegts"))
762-
matchF = 3;
761+
} else if (!strcmp(in_fmt->name, "mpegts")) {
762+
matchF = av_match_ext( seg->url, "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts")
763+
+ 2*(ff_match_url_ext(seg->url, "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts") > 0);
764+
}
763765

764766
if (!(matchA & matchF)) {
765767
av_log(s, AV_LOG_ERROR, "detected format %s extension %s mismatches allowed extensions in url %s\n", in_fmt->name, in_fmt->extensions ? in_fmt->extensions : "none", seg->url);

0 commit comments

Comments
 (0)