[FFmpeg-cvslog] af_amix: prevent memory leak on error path

Janne Grunau git at videolan.org
Wed Oct 10 13:23:59 CEST 2012


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Tue Oct  9 16:15:15 2012 +0200| [8501c098687bbf551a2f1cdef80ee653fdfff6ac] | committer: Janne Grunau

af_amix: prevent memory leak on error path

Fixes CID732272.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8501c098687bbf551a2f1cdef80ee653fdfff6ac
---

 libavfilter/af_amix.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index 202d675..a0b265f 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) {



More information about the ffmpeg-cvslog mailing list