Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Jamaika1 via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Jamaika1 <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] Fix: output size between 19 and 333 bytes into a destination of size 20 (PR #21291)
Date: Wed, 24 Dec 2025 12:18:41 -0000
Message-ID: <176657872218.25.9627973678130858526@4457048688e7> (raw)

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

                 reply	other threads:[~2025-12-24 12:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176657872218.25.9627973678130858526@4457048688e7 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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