Commit 2e47b816c8 for ffmpeg

commit 2e47b816c86468588df15a26bbd3ffa0a154f5c6
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Sun Oct 4 02:35:31 2026 +0200

    avformat/hls: free the ID3 data of later segments

    Fixes: memleak
    Fixes: T8gSaCwJwFtF/testcase/leak.m3u8 / gen_leak.py
    Fixes: T8gSaCwJwFtF
    Regression since: 01b184e68d
    Found during triage of the security report ANT-2026-HGVOM183
    Replicated through UnModified FFmpeg

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 5caf63b063..2c7121a217 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1332,7 +1332,7 @@ static void handle_id3(AVIOContext *pb, struct playlist *pls)
         av_dict_free(&metadata);
     }

-    if (!pls->id3_deferred_extra)
+    if (pls->id3_deferred_extra != extra_meta)
         ff_id3v2_free_extra_meta(&extra_meta);
 }