Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] Fix: output size between 19 and 333 bytes into a destination of size 20 (PR #21291)
@ 2025-12-24 12:18 Jamaika1 via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Jamaika1 via ffmpeg-devel @ 2025-12-24 12:18 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Jamaika1

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 <lukaszcz18@wp.pl>
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 -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-24 12:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-24 12:18 [FFmpeg-devel] [PATCH] Fix: output size between 19 and 333 bytes into a destination of size 20 (PR #21291) Jamaika1 via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git