PR #24080 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24080
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24080.patch

%zu expects a size_t, yet the argument is of type int64_t;
this is UB if size_t unless size_t is the corresponding unsigned
type to int64_t (i.e. it is UB on 32bit systems).



>From 844e10e1a74929c27dfe0aac1c34e92bb6edbf5a Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <[email protected]>
Date: Tue, 11 Aug 2026 16:12:07 +0200
Subject: [PATCH] avformat/shared: Use correct printf specifier

%zu expects a size_t, yet the argument is of type int64_t;
this is UB if size_t unless size_t is the corresponding unsigned
type to int64_t (i.e. it is UB on 32bit systems).

Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavformat/shared.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/shared.c b/libavformat/shared.c
index 87278f1288..5fd01b185e 100644
--- a/libavformat/shared.c
+++ b/libavformat/shared.c
@@ -475,7 +475,7 @@ static int spacemap_grow(URLContext *h, int64_t block)
     if (s->map_size > old_size) {
         num_blocks = (s->map_size - sizeof(Spacemap)) / sizeof(Block);
         av_log(h, AV_LOG_DEBUG,
-               "%s %zu bytes, capacity: %"PRId64" blocks = %zu MB\n",
+               "%s %zu bytes, capacity: %"PRId64" blocks = %"PRId64" MB\n",
                ret ? "Resized spacemap to" : "Mapped spacemap with",
                (size_t) s->map_size, num_blocks,
                (num_blocks * (int64_t) s->block_size) >> 20);
-- 
2.52.0

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

Reply via email to