Browse code

avfilter/af_sidechaincompress: Free out frame on error

Fix memleak
Fixes CID1197065 part 2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2016/02/04 01:09:24
Showing 1 changed files
... ...
@@ -188,7 +188,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
188 188
     AVFilterContext *ctx = link->dst;
189 189
     SidechainCompressContext *s = ctx->priv;
190 190
     AVFilterLink *outlink = ctx->outputs[0];
191
-    AVFrame *out, *in[2] = { NULL };
191
+    AVFrame *out = NULL, *in[2] = { NULL };
192 192
     double *dst;
193 193
     int nb_samples;
194 194
     int i;
... ...
@@ -213,6 +213,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
213 213
         if (!in[i]) {
214 214
             av_frame_free(&in[0]);
215 215
             av_frame_free(&in[1]);
216
+            av_frame_free(&out);
216 217
             return AVERROR(ENOMEM);
217 218
         }
218 219
         av_audio_fifo_read(s->fifo[i], (void **)in[i]->data, nb_samples);