[FFmpeg-cvslog] avfilter/vf_fftdnoiz: Check return value of av_tx_init()
Andreas Rheinhardt
git at videolan.org
Sat Nov 12 14:44:51 EET 2022
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Nov 9 16:33:38 2022 +0100| [bfab87a61dde2084911d1f7d0e656912199219c8] | committer: Andreas Rheinhardt
avfilter/vf_fftdnoiz: Check return value of av_tx_init()
Should fix Coverity issue #1500329.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfab87a61dde2084911d1f7d0e656912199219c8
---
libavfilter/vf_fftdnoiz.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/libavfilter/vf_fftdnoiz.c b/libavfilter/vf_fftdnoiz.c
index e74f40b4cb..7b20ad367d 100644
--- a/libavfilter/vf_fftdnoiz.c
+++ b/libavfilter/vf_fftdnoiz.c
@@ -208,13 +208,17 @@ static int config_input(AVFilterLink *inlink)
for (int i = 0; i < s->nb_threads; i++) {
float scale = 1.f, iscale = 1.f;
-
- av_tx_init(&s->fft[i], &s->tx_fn, AV_TX_FLOAT_FFT, 0, s->block_size, &scale, 0);
- av_tx_init(&s->ifft[i], &s->itx_fn, AV_TX_FLOAT_FFT, 1, s->block_size, &iscale, 0);
- av_tx_init(&s->fft_r[i], &s->tx_r_fn, AV_TX_FLOAT_FFT, 0, 1 + s->nb_prev + s->nb_next, &scale, 0);
- av_tx_init(&s->ifft_r[i], &s->itx_r_fn, AV_TX_FLOAT_FFT, 1, 1 + s->nb_prev + s->nb_next, &iscale, 0);
- if (!s->fft[i] || !s->ifft[i] || !s->fft_r[i] || !s->ifft_r[i])
- return AVERROR(ENOMEM);
+ int ret;
+
+ if ((ret = av_tx_init(&s->fft[i], &s->tx_fn, AV_TX_FLOAT_FFT,
+ 0, s->block_size, &scale, 0)) < 0 ||
+ (ret = av_tx_init(&s->ifft[i], &s->itx_fn, AV_TX_FLOAT_FFT,
+ 1, s->block_size, &iscale, 0)) < 0 ||
+ (ret = av_tx_init(&s->fft_r[i], &s->tx_r_fn, AV_TX_FLOAT_FFT,
+ 0, 1 + s->nb_prev + s->nb_next, &scale, 0)) < 0 ||
+ (ret = av_tx_init(&s->ifft_r[i], &s->itx_r_fn, AV_TX_FLOAT_FFT,
+ 1, 1 + s->nb_prev + s->nb_next, &iscale, 0)) < 0)
+ return ret;
}
for (i = 0; i < s->nb_planes; i++) {
More information about the ffmpeg-cvslog
mailing list