[FFmpeg-devel] [PATCH] avformat/hls: fix handle_init_section_args callback type (PR #20124)
Kacper Michajłow
code at ffmpeg.org
Tue Aug 5 20:33:50 EEST 2025
PR #20124 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20124
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20124.patch
From 9e0c4693414bc97587d234b60c76a2470ee45e0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93 at gmail.com>
Date: Mon, 4 Aug 2025 02:42:28 +0200
Subject: [PATCH 1/2] avutil/tx: zero whole array, not only one element
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Kacper Michajłow <kasper93 at gmail.com>
---
libavutil/tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/tx.c b/libavutil/tx.c
index 0aae4c7cf7..05c132ada1 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -284,7 +284,7 @@ static void reset_ctx(AVTXContext *s, int free_sub)
* ff_tx_init_subtx() call is made. */
s->nb_sub = 0;
s->opaque = NULL;
- memset(s->fn, 0, sizeof(*s->fn));
+ memset(s->fn, 0, sizeof(s->fn));
}
void ff_tx_clear_ctx(AVTXContext *s)
--
2.49.1
From a8b32a0b0a5f3cea033842b43ce293bbb8d761bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93 at gmail.com>
Date: Tue, 5 Aug 2025 19:26:50 +0200
Subject: [PATCH 2/2] avformat/hls: fix handle_init_section_args callback type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes: utils.c:524:9: runtime error: call to function
handle_init_section_args through pointer to incorrect function type
'void (*)(void *, const char *, int, char **, int *)'
Signed-off-by: Kacper Michajłow <kasper93 at gmail.com>
---
libavformat/hls.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 505fb6146f..22ee1c6872 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -462,9 +462,10 @@ static struct segment *new_init_section(struct playlist *pls,
return sec;
}
-static void handle_init_section_args(struct init_section_info *info, const char *key,
- int key_len, char **dest, int *dest_len)
+static void handle_init_section_args(void *context, const char *key,
+ int key_len, char **dest, int *dest_len)
{
+ struct init_section_info *info = context;
if (!strncmp(key, "URI=", key_len)) {
*dest = info->uri;
*dest_len = sizeof(info->uri);
@@ -916,8 +917,7 @@ static int parse_playlist(HLSContext *c, const char *url,
ret = ensure_playlist(c, &pls, url);
if (ret < 0)
goto fail;
- ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_init_section_args,
- &info);
+ ff_parse_key_value(ptr, handle_init_section_args, &info);
cur_init_section = new_init_section(pls, &info, url);
if (!cur_init_section) {
ret = AVERROR(ENOMEM);
--
2.49.1
More information about the ffmpeg-devel
mailing list