Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Muhammad Faiz <mfcc64@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avfilter/avf_showcqt: fix unbounded index when copying to fft_data
Date: Fri, 8 Aug 2025 06:23:39 +0700
Message-ID: <CAJsO9v6B+yQ6XLkiTNbmCe+kop-ct6v3NgvnBkD2fogvD7iNhA@mail.gmail.com> (raw)
In-Reply-To: <20250703134810.37587-1-mfcc64@gmail.com>

On Thu, Jul 3, 2025 at 8:48 PM Muhammad Faiz <mfcc64@gmail.com> wrote:

> When timeclamp and/or fps are low, j can be negative.
>
> Fix Ticket11640
> ---
>  libavfilter/avf_showcqt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
> index 8ff6ecb..8f9b782 100644
> --- a/libavfilter/avf_showcqt.c
> +++ b/libavfilter/avf_showcqt.c
> @@ -1515,7 +1515,7 @@ static int filter_frame(AVFilterLink *inlink,
> AVFrame *insamples)
>          i = insamples->nb_samples - remaining;
>          j = s->fft_len/2 + s->remaining_fill_max - s->remaining_fill;
>          if (remaining >= s->remaining_fill) {
> -            for (m = 0; m < s->remaining_fill; m++) {
> +            for (m = FFMAX(0, -j); m < s->remaining_fill; m++) {
>                  s->fft_data[j+m].re = audio_data[2*(i+m)];
>                  s->fft_data[j+m].im = audio_data[2*(i+m)+1];
>              }
> @@ -1544,7 +1544,7 @@ static int filter_frame(AVFilterLink *inlink,
> AVFrame *insamples)
>                  s->fft_data[m] = s->fft_data[m+step];
>              s->remaining_fill = step;
>          } else {
> -            for (m = 0; m < remaining; m++) {
> +            for (m = FFMAX(0, -j); m < remaining; m++) {
>                  s->fft_data[j+m].re = audio_data[2*(i+m)];
>                  s->fft_data[j+m].im = audio_data[2*(i+m)+1];
>              }
> --
> 2.43.0
>
>
Ping
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2025-08-07 23:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 13:47 Muhammad Faiz
2025-08-07 23:23 ` Muhammad Faiz [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=CAJsO9v6B+yQ6XLkiTNbmCe+kop-ct6v3NgvnBkD2fogvD7iNhA@mail.gmail.com \
    --to=mfcc64@gmail.com \
    --cc=ffmpeg-devel@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