PR #24083 opened by ffmpeg-devel
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24083
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24083.patch

**Backport:** https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24080

%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 bd4a4a0e55bb4ab5d4cf5982f4d1855899921538 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]>
(cherry picked from commit 844e10e1a74929c27dfe0aac1c34e92bb6edbf5a)
---
 libavformat/shared.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/shared.c b/libavformat/shared.c
index 7c8b17350c..9d8474588e 100644
--- a/libavformat/shared.c
+++ b/libavformat/shared.c
@@ -466,7 +466,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