This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new c364ab176f avformat/hls: reject Master Playlist tags in a Media
Playlist
c364ab176f is described below
commit c364ab176f722bdabc886845e770c9eacbc1e3e5
Author: Kacper Michajłow <[email protected]>
AuthorDate: Sat Jun 27 17:43:33 2026 +0200
Commit: Kacper Michajłow <[email protected]>
CommitDate: Sun Jul 5 02:34:41 2026 +0000
avformat/hls: reject Master Playlist tags in a Media Playlist
Fixes infinite loop on crafted HLS playlists.
Fixes: recursion.m3u8
Fixes: cEy2cxyyPaLH
Fixes: cd223e0b4e (Add Apple HTTP Live Streaming demuxer)
Found-by: BapToutatis
Signed-off-by: Kacper Michajłow <[email protected]>
---
libavformat/hls.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libavformat/hls.c b/libavformat/hls.c
index b3b8f3a80a..e76e68ed51 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -890,6 +890,12 @@ static int parse_playlist(HLSContext *c, const char *url,
while (!avio_feof(in)) {
ff_get_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
+ if (pls) {
+ av_log(c->ctx, AV_LOG_ERROR,
+ "Master Playlist tag found in a Media Playlist\n");
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
is_variant = 1;
memset(&variant_info, 0, sizeof(variant_info));
ff_parse_key_value(ptr, handle_variant_args, &variant_info);
@@ -909,6 +915,12 @@ static int parse_playlist(HLSContext *c, const char *url,
av_strlcpy(key, info.uri, sizeof(key));
} else if (av_strstart(line, "#EXT-X-MEDIA:", &ptr)) {
struct rendition_info info = {{0}};
+ if (pls) {
+ av_log(c->ctx, AV_LOG_ERROR,
+ "Master Playlist tag found in a Media Playlist\n");
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
ff_parse_key_value(ptr, handle_rendition_args, &info);
new_rendition(c, &info, url);
} else if (av_strstart(line, "#EXT-X-TARGETDURATION:", &ptr)) {
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]