From: Nicolas George via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: 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: Fri, 12 Sep 2025 15:23:35 +0200 Message-ID: <aMQe12tG4g_sXgUW@phare.normalesup.org> (raw) In-Reply-To: <829558c0-f800-6070-0d38-92f202c7a092@passwd.hu> Sorry, lots of things to do these last weeks. Marton Balint via ffmpeg-devel (HE12025-08-26): > I just thought that for the typical case we can spare an strlen() call this > way. Except if the format is pathologically long, which is not a case we want to optimize for, I suspect the branching is more expensive than the counting. > > I think a lower margin should be ok, >>4 or >>5. > I'd rather keep it >>8, because strftime format strings can also have width > specifiers, so something like "%80c" should work. Obviously this is always > going to be a heuristics, but I wanted to be careful and reject only the > very unlikely/insane format strings... I am worried that this large value can cause bprint to go beyond the built-in buffer and allocate more memory just to be sure. But we are in a pathological case anyway, so go ahead. > There is one, but OK, I will make the existing comment a bit more verbose. Thanks. Regards, -- Nicolas George _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
prev parent reply other threads:[~2025-09-12 13:24 UTC|newest] Thread overview: 5+ 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 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 2025-09-12 13:23 ` Nicolas George via ffmpeg-devel [this message]
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=aMQe12tG4g_sXgUW@phare.normalesup.org \ --to=ffmpeg-devel@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