avfilter/f_loop: Fix leak on error
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 29 May 2016 19:21:59 +0000 (21:21 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 29 May 2016 19:21:59 +0000 (21:21 +0200)
Fixes CID1355117

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/f_loop.c

index d8eb692..00e0215 100644 (file)
@@ -88,8 +88,10 @@ static int push_samples(AVFilterContext *ctx, int nb_samples)
         if (!out)
             return AVERROR(ENOMEM);
         ret = av_audio_fifo_peek_at(s->fifo, (void **)out->extended_data, out->nb_samples, s->current_sample);
-        if (ret < 0)
+        if (ret < 0) {
+            av_frame_free(&out);
             return ret;
+        }
         out->pts = s->pts;
         out->nb_samples = ret;
         s->pts += out->nb_samples;