diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c index 067ce7eb30..1953e969a0 100644 --- a/libavfilter/vf_fftfilt.c +++ b/libavfilter/vf_fftfilt.c @@ -306,7 +306,7 @@ static int config_props(AVFilterLink *inlink) { FFTFILTContext *s = inlink->dst->priv; const AVPixFmtDescriptor *desc; - int i, plane; + int ret, i, plane; desc = av_pix_fmt_desc_get(inlink->format); s->depth = desc->comp[0].depth; @@ -335,12 +335,14 @@ static int config_props(AVFilterLink *inlink) for (int j = 0; j < s->nb_threads; j++) { float scale = 1.f, iscale = 1.f; - av_tx_init(&s->hrdft[j][i], &s->htx_fn, AV_TX_FLOAT_RDFT, 0, 1 << s->rdft_hbits[i], &scale, 0); - if (!s->hrdft[j][i]) - return AVERROR(ENOMEM); - av_tx_init(&s->ihrdft[j][i], &s->ihtx_fn, AV_TX_FLOAT_RDFT, 1, 1 << s->rdft_hbits[i], &iscale, 0); - if (!s->ihrdft[j][i]) - return AVERROR(ENOMEM); + ret = av_tx_init(&s->hrdft[j][i], &s->htx_fn, AV_TX_FLOAT_RDFT, + 0, 1 << s->rdft_hbits[i], &scale, 0); + if (ret < 0) + return ret; + ret = av_tx_init(&s->ihrdft[j][i], &s->ihtx_fn, AV_TX_FLOAT_RDFT, + 1, 1 << s->rdft_hbits[i], &iscale, 0); + if (ret < 0) + return ret; } /* RDFT - Array initialization for Vertical pass*/ @@ -356,12 +358,14 @@ static int config_props(AVFilterLink *inlink) for (int j = 0; j < s->nb_threads; j++) { float scale = 1.f, iscale = 1.f; - av_tx_init(&s->vrdft[j][i], &s->vtx_fn, AV_TX_FLOAT_RDFT, 0, 1 << s->rdft_vbits[i], &scale, 0); - if (!s->vrdft[j][i]) - return AVERROR(ENOMEM); - av_tx_init(&s->ivrdft[j][i], &s->ivtx_fn, AV_TX_FLOAT_RDFT, 1, 1 << s->rdft_vbits[i], &iscale, 0); - if (!s->ivrdft[j][i]) - return AVERROR(ENOMEM); + ret = av_tx_init(&s->vrdft[j][i], &s->vtx_fn, AV_TX_FLOAT_RDFT, + 0, 1 << s->rdft_vbits[i], &scale, 0); + if (ret < 0) + return ret; + ret = av_tx_init(&s->ivrdft[j][i], &s->ivtx_fn, AV_TX_FLOAT_RDFT, + 1, 1 << s->rdft_vbits[i], &iscale, 0); + if (ret < 0) + return ret; } }