History

avfilter/af_atempo: Properly check av_tx_init()

Fixes Coverity issue #1516804.

Andreas Rheinhardt committed 2 years ago

Commit 35e7fa01 parent 2e877091 file · +9 −6Browse files

Unified · Split

libavfilter/af_atempo.c+9−6
@@ -269,6 +269,7 @@ static int yae_reset(ATempoContext *atempo, · 268 unmodified lines
269269 uint32_t nlevels = 0;
270270 float scale = 1.f, iscale = 1.f;
271271 uint32_t pot;
272+ int ret;
272273 int i;
273274
274275 atempo->format = format;
@@ -300,16 +301,18 @@ static int yae_reset(ATempoContext *atempo, · 25 unmodified lines
300301 av_tx_uninit(&atempo->real_to_complex);
301302 av_tx_uninit(&atempo->complex_to_real);
302303
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) {
305307 yae_release_buffers(atempo);
306− return AVERROR(ENOMEM);
308+ return ret;
307309 }
308310
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) {
311314 yae_release_buffers(atempo);
312− return AVERROR(ENOMEM);
315+ return ret;
313316 }
314317
315318 RE_MALLOC_OR_FAIL(atempo->correlation_in, (atempo->window + 1), sizeof(AVComplexFloat));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t