Commit 051b8db722 for ffmpeg

commit 051b8db7221f308b242ddb72428d9ca10f14757c
Author: Kacper Michajłow <kasper93@gmail.com>
Date:   Tue Sep 29 11:34:17 2026 +0200

    avformat/hls: free the subtitle context if copying the whitelists fails

    Free it like the other error paths of init_subtitle_context() do.

    Signed-off-by: Kacper Michajłow <kasper93@gmail.com>

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 97755da3a3..5c530215e0 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1950,8 +1950,11 @@ static int init_subtitle_context(struct playlist *pls)
     pls->ctx->io_open  = nested_io_open;

     ret = ff_copy_whiteblacklists(pls->ctx, pls->parent);
-    if (ret < 0)
+    if (ret < 0) {
+        avformat_free_context(pls->ctx);
+        pls->ctx = NULL;
         return ret;
+    }

     in_fmt = av_find_input_format("webvtt");
     av_dict_copy(&opts, c->seg_format_opts, 0);