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

```
matroskaenc1.c:3349:79: warning: '%012.9f' directive output may be truncated 
writing between 12 and 320 bytes into a region of size between 8 and 14 
[-Wformat-truncation=]
 3349 |                 snprintf(duration_string, sizeof(duration_string), 
"%02d:%02d:%012.9f",
      |                                                                         
      ^~~~~~~
matroskaenc1.c:3349:17: note: 'snprintf' output between 19 and 333 bytes into a 
destination of size 20
 3349 |                 snprintf(duration_string, sizeof(duration_string), 
"%02d:%02d:%012.9f",
      |                 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3350 |                          (int) duration_sec / 3600, ((int) duration_sec 
/ 60) % 60,
      |                          
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3351 |                          fmod(duration_sec, 60));
      |                          ~~~~~~~~~~~~~~~~~~~~~~~
```


>From cafb3e18801a1847326f4cb2ef85ff2105b10dc5 Mon Sep 17 00:00:00 2001
From: Jamaika1 <[email protected]>
Date: Wed, 24 Dec 2025 12:18:06 +0000
Subject: [PATCH] Fix: output size between 19 and 333 bytes into a destination
 of size 20

```
matroskaenc1.c:3349:79: warning: '%012.9f' directive output may be truncated 
writing between 12 and 320 bytes into a region of size between 8 and 14 
[-Wformat-truncation=]
 3349 |                 snprintf(duration_string, sizeof(duration_string), 
"%02d:%02d:%012.9f",
      |                                                                         
      ^~~~~~~
matroskaenc1.c:3349:17: note: 'snprintf' output between 19 and 333 bytes into a 
destination of size 20
 3349 |                 snprintf(duration_string, sizeof(duration_string), 
"%02d:%02d:%012.9f",
      |                 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3350 |                          (int) duration_sec / 3600, ((int) duration_sec 
/ 60) % 60,
      |                          
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3351 |                          fmod(duration_sec, 60));
      |                          ~~~~~~~~~~~~~~~~~~~~~~~
```
---
 libavformat/matroskaenc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 18f17f4329..053efead7e 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3332,7 +3332,11 @@ after_cues:
 
             if (track->duration_offset > 0) {
                 double duration_sec = track->duration * av_q2d(st->time_base);
+#ifdef __MINGW32__
+                char duration_string[333] = "";
+#else
                 char duration_string[DURATION_STRING_LENGTH + 1] = "";
+#endif
                 ebml_master simpletag;
 
                 av_log(s, AV_LOG_DEBUG, "stream %d end duration = %" PRIu64 
"\n", i,
-- 
2.49.1

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

Reply via email to