Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Nicolas George via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Marton Balint <code@ffmpeg.org>, Nicolas George <george@nsup.org>
Subject: [FFmpeg-devel] Re: [PATCH] avutil/bprint: fix av_bprint_strftime with %p format string reporting truncated output (PR #20330)
Date: Tue, 26 Aug 2025 20:05:46 +0200
Message-ID: <aK33euaC77PF-iiZ@phare.normalesup.org> (raw)
In-Reply-To: <20250824203654.4450A68E704@ffbox0-bg.ffmpeg.org>

Marton Balint via ffmpeg-devel (HE12025-08-24):
> >From f8e83bce6269c95fbad90f34434ceb641bf753d5 Mon Sep 17 00:00:00 2001
> From: Marton Balint <cus@passwd.hu>
> Date: Sun, 24 Aug 2025 21:42:54 +0200
> Subject: [PATCH 1/2] avutil/bprint: make av_bprintf use av_vbprintf
> 
> No reason to duplicate the code.
> 
> Signed-off-by: Marton Balint <cus@passwd.hu>

No objection.

> ---
>  libavutil/bprint.c | 33 +++++++++------------------------
>  1 file changed, 9 insertions(+), 24 deletions(-)
> 
> diff --git a/libavutil/bprint.c b/libavutil/bprint.c
> index 4e9571715c..932c03ce50 100644
> --- a/libavutil/bprint.c
> +++ b/libavutil/bprint.c
> @@ -96,35 +96,12 @@ void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size)
>      *buf->str = 0;
>  }
>  
> -void av_bprintf(AVBPrint *buf, const char *fmt, ...)
> -{
> -    unsigned room;
> -    char *dst;
> -    va_list vl;
> -    int extra_len;
> -
> -    while (1) {
> -        room = av_bprint_room(buf);
> -        dst = room ? buf->str + buf->len : NULL;
> -        va_start(vl, fmt);
> -        extra_len = vsnprintf(dst, room, fmt, vl);
> -        va_end(vl);
> -        if (extra_len <= 0)
> -            return;
> -        if (extra_len < room)
> -            break;
> -        if (av_bprint_alloc(buf, extra_len))
> -            break;
> -    }
> -    av_bprint_grow(buf, extra_len);
> -}
> -
>  void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg)
>  {
>      unsigned room;
>      char *dst;

> -    int extra_len;
>      va_list vl;
> +    int extra_len;

Uh?

>  
>      while (1) {
>          room = av_bprint_room(buf);
> @@ -142,6 +119,14 @@ void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg)
>      av_bprint_grow(buf, extra_len);
>  }
>  
> +void av_bprintf(AVBPrint *buf, const char *fmt, ...)
> +{
> +    va_list vl;
> +    va_start(vl, fmt);
> +    av_vbprintf(buf, fmt, vl);
> +    va_end(vl);
> +}
> +
>  void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
>  {
>      unsigned room, real_n;

Regards,

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

       reply	other threads:[~2025-08-26 18:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250824203654.4450A68E704@ffbox0-bg.ffmpeg.org>
2025-08-26 18:05 ` Nicolas George via ffmpeg-devel [this message]
2025-08-26 19:17   ` Marton Balint via ffmpeg-devel
2025-08-26 18:18 ` Nicolas George via ffmpeg-devel
2025-08-26 19:50   ` Marton Balint via ffmpeg-devel

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=aK33euaC77PF-iiZ@phare.normalesup.org \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    --cc=george@nsup.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