From 8501c098687bbf551a2f1cdef80ee653fdfff6ac Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 9 Oct 2012 16:15:15 +0200 Subject: af_amix: prevent memory leak on error path Fixes CID732272. --- libavfilter/af_amix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavfilter/af_amix.c') diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index 202d67541c..a0b265fa34 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -285,8 +285,10 @@ static int output_frame(AVFilterLink *outlink, int nb_samples) return AVERROR(ENOMEM); in_buf = ff_get_audio_buffer(outlink, AV_PERM_WRITE, nb_samples); - if (!in_buf) + if (!in_buf) { + avfilter_unref_buffer(out_buf); return AVERROR(ENOMEM); + } for (i = 0; i < s->nb_inputs; i++) { if (s->input_state[i] == INPUT_ON) { -- cgit v1.2.3