[PR] avformat/dashenc: defer HTTP options allocation (PR #24179)

jiangjie via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <[email protected]>
PR #24179 opened by jiangjie
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24179
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24179.patch

Fixes issue #24171




>From 5826330159232df1eb0d25a82f070ae6cb2b1a41 Mon Sep 17 00:00:00 2001
From: jiangjie <[email protected]>
Date: Mon, 17 Aug 2026 18:32:56 +0800
Subject: [PATCH] avformat/dashenc: defer HTTP options allocation

Fixes issue #24171
---
 libavformat/dashenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 406ee2cf0d..c7aea0ce1c 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1463,8 +1463,10 @@ static int dash_init(AVFormatContext *s)
         snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile);
         set_http_options(&opts, c);
         if (!c->single_file) {
-            if ((ret = avio_open_dyn_buf(&ctx->pb)) < 0)
+            if ((ret = avio_open_dyn_buf(&ctx->pb)) < 0) {
+                av_dict_free(&opts);
                 return ret;
+            }
             ret = s->io_open(s, &os->out, filename, AVIO_FLAG_WRITE, &opts);
         } else {
             ctx->url = av_strdup(filename);
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.