PR #23095 opened by Marton Balint (cus)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23095
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23095.patch

Fixes compliation on MSVC.


>From 1dfd0d352c67f6eea298a51d85b0d34b0e71bb52 Mon Sep 17 00:00:00 2001
From: Marton Balint <[email protected]>
Date: Thu, 14 May 2026 01:39:49 +0200
Subject: [PATCH] avformat/utils: avoid void pointer arithmetic

Fixes compliation on MSVC.
---
 libavformat/utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 0192dba97f..1e7cebb32b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -692,13 +692,13 @@ void *ff_bprint_finalize_as_fam(struct AVBPrint *bp, 
const void *struct_ptr, siz
         return NULL;
     }
 
-    void *p = av_malloc(struct_size + bp->len);
+    char *p = av_malloc(struct_size + bp->len);
     if (!p) {
         av_bprint_finalize(bp, NULL);
         return NULL;
     }
     memcpy(p, struct_ptr, struct_size);
-    memcpy(p + (flex_member - struct_ptr), bp->str, bp->len);
+    memcpy(p + ((char *)flex_member - (char *)struct_ptr), bp->str, bp->len);
     av_bprint_finalize(bp, NULL);
 
     return p;
-- 
2.52.0

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

Reply via email to