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 | uint32_t nlevels = 0; | 269 | uint32_t nlevels = 0; |
| 270 | float scale = 1.f, iscale = 1.f; | 270 | float scale = 1.f, iscale = 1.f; |
| 271 | uint32_t pot; | 271 | uint32_t pot; |
| 272 | int ret; | ||
| 272 | int i; | 273 | int i; |
| 273 | 274 | ||
| 274 | atempo->format = format; | 275 | atempo->format = format; |
| @@ -300,16 +301,18 @@ static int yae_reset(ATempoContext *atempo, · 25 unmodified lines | |||
| 300 | av_tx_uninit(&atempo->real_to_complex); | 301 | av_tx_uninit(&atempo->real_to_complex); |
| 301 | av_tx_uninit(&atempo->complex_to_real); | 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 | ret = av_tx_init(&atempo->real_to_complex, &atempo->r2c_fn, |
| 304 | if (!atempo->real_to_complex) { | 305 | AV_TX_FLOAT_RDFT, 0, 1 << (nlevels + 1), &scale, 0); |
| 306 | if (ret < 0) { | ||
| 305 | yae_release_buffers(atempo); | 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); | 311 | ret = av_tx_init(&atempo->complex_to_real, &atempo->c2r_fn, |
| 310 | if (!atempo->complex_to_real) { | 312 | AV_TX_FLOAT_RDFT, 1, 1 << (nlevels + 1), &iscale, 0); |
| 313 | if (ret < 0) { | ||
| 311 | yae_release_buffers(atempo); | 314 | yae_release_buffers(atempo); |
| 312 | return AVERROR(ENOMEM); | 315 | return ret; |
| 313 | } | 316 | } |
| 314 | 317 | ||
| 315 | RE_MALLOC_OR_FAIL(atempo->correlation_in, (atempo->window + 1), sizeof(AVComplexFloat)); | 318 | RE_MALLOC_OR_FAIL(atempo->correlation_in, (atempo->window + 1), sizeof(AVComplexFloat)); |