PR #22754 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22754
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22754.patch

Technically it's is UB to call function of different type.

Fixes:
src/libavformat/utils.c:531:9: runtime error: call to function 
handle_variant_args through pointer to incorrect function type 'void (*)(void 
*, const char *, int, char **, int *)'
src/libavformat/hls.c:379: note: handle_variant_args defined here

Signed-off-by: Kacper Michajłow <[email protected]>


From 37a9385e3225e1d6b9b719d43e8426feeefca3bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 8 Apr 2026 19:16:02 +0200
Subject: [PATCH] avformat/hls: fix callback function type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Technically it's is UB to call function of different type.

Fixes:
src/libavformat/utils.c:531:9: runtime error: call to function 
handle_variant_args through pointer to incorrect function type 'void (*)(void 
*, const char *, int, char **, int *)'
src/libavformat/hls.c:379: note: handle_variant_args defined here

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavformat/hls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 28c883097a..95cf25ee06 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -374,9 +374,10 @@ static struct variant *new_variant(HLSContext *c, struct 
variant_info *info,
     return var;
 }
 
-static void handle_variant_args(struct variant_info *info, const char *key,
+static void handle_variant_args(void *context, const char *key,
                                 int key_len, char **dest, int *dest_len)
 {
+    struct variant_info *info = context;
     if (!strncmp(key, "BANDWIDTH=", key_len)) {
         *dest     =        info->bandwidth;
         *dest_len = sizeof(info->bandwidth);
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to