Fixes Coverity issue #1516804.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -269,6 +269,7 @@ static int yae_reset(ATempoContext *atempo, · 268 unmodified lines | ||
| 269 | 269 | uint32_t nlevels = 0; |
| 270 | 270 | float scale = 1.f, iscale = 1.f; |
| 271 | 271 | uint32_t pot; |
| 272 | + int ret; | |
| 272 | 273 | int i; |
| 273 | 274 | |
| 274 | 275 | atempo->format = format; |
| @@ -300,16 +301,18 @@ static int yae_reset(ATempoContext *atempo, · 25 unmodified lines | ||
| 300 | 301 | av_tx_uninit(&atempo->real_to_complex); |
| 301 | 302 | av_tx_uninit(&atempo->complex_to_real); |
| 302 | 303 | |
| 303 | − av_tx_init(&atempo->real_to_complex, &atempo->r2c_fn, AV_TX_FLOAT_RDFT, 0, 1 << (nlevels + 1), &scale, 0); | |
| 304 | − if (!atempo->real_to_complex) { | |
| 304 | + ret = av_tx_init(&atempo->real_to_complex, &atempo->r2c_fn, | |
| 305 | + AV_TX_FLOAT_RDFT, 0, 1 << (nlevels + 1), &scale, 0); | |
| 306 | + if (ret < 0) { | |
| 305 | 307 | yae_release_buffers(atempo); |
| 306 | − return AVERROR(ENOMEM); | |
| 308 | + return ret; | |
| 307 | 309 | } |
| 308 | 310 | |
| 309 | − av_tx_init(&atempo->complex_to_real, &atempo->c2r_fn, AV_TX_FLOAT_RDFT, 1, 1 << (nlevels + 1), &iscale, 0); | |
| 310 | − if (!atempo->complex_to_real) { | |
| 311 | + ret = av_tx_init(&atempo->complex_to_real, &atempo->c2r_fn, | |
| 312 | + AV_TX_FLOAT_RDFT, 1, 1 << (nlevels + 1), &iscale, 0); | |
| 313 | + if (ret < 0) { | |
| 311 | 314 | yae_release_buffers(atempo); |
| 312 | − return AVERROR(ENOMEM); | |
| 315 | + return ret; | |
| 313 | 316 | } |
| 314 | 317 | |
| 315 | 318 | RE_MALLOC_OR_FAIL(atempo->correlation_in, (atempo->window + 1), sizeof(AVComplexFloat)); |