mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-10-19 09:53:18 +00:00
avfilter/avf_showcqt: fix unbounded index when copying to fft_data
When timeclamp and/or fps are low, j can be negative.
Fix Ticket11640
(cherry picked from commit 35ea458354
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a4d35d1392
commit
5ccc56161b
1 changed files with 2 additions and 2 deletions
|
@ -1516,7 +1516,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];
|
||||
}
|
||||
|
@ -1550,7 +1550,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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue