This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/8.1
in repository ffmpeg.

commit a4ddaba8bb7811b1a3afaad59fe6555e720d4754
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Sat Jun 27 17:43:33 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sat Sep 19 14:26:51 2026 +0200

    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]>
    (cherry picked from commit c364ab176f722bdabc886845e770c9eacbc1e3e5)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/hls.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 2f7142fd4d..55676bb73c 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -864,6 +864,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, (ff_parse_key_val_cb) handle_variant_args,
@@ -885,6 +891,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, (ff_parse_key_val_cb) 
handle_rendition_args,
                                &info);
             new_rendition(c, &info, url);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to