History

avfilter/af_afftfilt: fix memory leaks on error

Paul B Mahol committed 6 years ago

Commit 53a485c1 parent 2174a311 file · +3 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_afftfilt.c+3−1
@@ -40,6 +40,7 @@ typedef struct AFFTFiltContext { · 39 unmodified lines
40 FFTComplex **fft_data;40 FFTComplex **fft_data;
41 FFTComplex **fft_temp;41 FFTComplex **fft_temp;
42 int nb_exprs;42 int nb_exprs;
43 int channels;
43 int window_size;44 int window_size;
44 AVExpr **real;45 AVExpr **real;
45 AVExpr **imag;46 AVExpr **imag;
@@ -129,6 +130,7 @@ static int config_input(AVFilterLink *inlink) · 83 unmodified lines
129 char *args;130 char *args;
130 const char *last_expr = "1";131 const char *last_expr = "1";
131 132
133 s->channels = inlink->channels;
132 s->pts = AV_NOPTS_VALUE;134 s->pts = AV_NOPTS_VALUE;
133 s->fft_bits = av_log2(s->fft_size);135 s->fft_bits = av_log2(s->fft_size);
134 s->fft = av_fft_init(s->fft_bits, 0);136 s->fft = av_fft_init(s->fft_bits, 0);
@@ -435,7 +437,7 @@ static av_cold void uninit(AVFilterContext *ctx) · 300 unmodified lines
435 av_fft_end(s->fft);437 av_fft_end(s->fft);
436 av_fft_end(s->ifft);438 av_fft_end(s->ifft);
437 439
438 for (i = 0; i < s->nb_exprs; i++) {440 for (i = 0; i < s->channels; i++) {
439 if (s->fft_data)441 if (s->fft_data)
440 av_freep(&s->fft_data[i]);442 av_freep(&s->fft_data[i]);
441 if (s->fft_temp)443 if (s->fft_temp)

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