[FFmpeg-cvslog] af_resample: unref out_buf when avresample_convert returns 0

Janne Grunau git at videolan.org
Wed Oct 10 13:24:00 CEST 2012


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

af_resample: unref out_buf when avresample_convert returns 0

Fixes CID732273.

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

 libavfilter/af_resample.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c
index 58a9b2a..c43d260 100644
--- a/libavfilter/af_resample.c
+++ b/libavfilter/af_resample.c
@@ -194,9 +194,10 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
                                      buf_out->linesize[0], nb_samples,
                                      buf->extended_data, buf->linesize[0],
                                      buf->audio->nb_samples);
-        if (ret < 0) {
+        if (ret <= 0) {
             avfilter_unref_buffer(buf_out);
-            goto fail;
+            if (ret < 0)
+                goto fail;
         }
 
         av_assert0(!avresample_available(s->avr));



More information about the ffmpeg-cvslog mailing list