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
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));

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