mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-04-18 16:40:23 +00:00
avfilter/avf_showspectrum: Fix allocation check
If s->stop is set, the return value would be overwritten
before being checked. This bug was introduced in the switch
to AV_TX in 014ace8f98.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
c1be2107c9
commit
0992c19c30
1 changed files with 5 additions and 5 deletions
|
|
@ -1143,6 +1143,11 @@ static int config_output(AVFilterLink *outlink)
|
|||
float scale = 1.f;
|
||||
|
||||
ret = av_tx_init(&s->fft[i], &s->tx_fn, AV_TX_FLOAT_FFT, 0, fft_size << (!!s->stop), &scale, 0);
|
||||
if (ret < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Unable to create FFT context. "
|
||||
"The window size might be too high.\n");
|
||||
return ret;
|
||||
}
|
||||
if (s->stop) {
|
||||
ret = av_tx_init(&s->ifft[i], &s->itx_fn, AV_TX_FLOAT_FFT, 1, fft_size << (!!s->stop), &scale, 0);
|
||||
if (ret < 0) {
|
||||
|
|
@ -1151,11 +1156,6 @@ static int config_output(AVFilterLink *outlink)
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
if (ret < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Unable to create FFT context. "
|
||||
"The window size might be too high.\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
s->magnitudes = av_calloc(s->nb_display_channels, sizeof(*s->magnitudes));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue