[FFmpeg-cvslog] avfilter/vf_qp: fix cleanup on error

Michael Niedermayer git at videolan.org
Tue Apr 21 14:27:08 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Apr 21 14:11:30 2015 +0200| [8f9a3817d502a46e1349befac24c7d2311df4e12] | committer: Michael Niedermayer

avfilter/vf_qp: fix cleanup on error

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/vf_qp.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_qp.c b/libavfilter/vf_qp.c
index 0c805af..e4b6bf0 100644
--- a/libavfilter/vf_qp.c
+++ b/libavfilter/vf_qp.c
@@ -90,7 +90,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     AVFilterLink *outlink = ctx->outputs[0];
     QPContext *s = ctx->priv;
     AVBufferRef *out_qp_table_buf;
-    AVFrame *out;
+    AVFrame *out = NULL;
     const int8_t *in_qp_table;
     int type, stride, ret;
 
@@ -129,7 +129,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
                                             var_names, var_values,
                                             NULL, NULL, NULL, NULL, 0, 0, ctx);
                 if (ret < 0)
-                    return ret;
+                    goto fail;
                 out_qp_table_buf->data[x + s->qstride * y] = lrintf(temp_val);
             }
     } else if (in_qp_table) {
@@ -148,8 +148,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     }
 
     ret = ff_filter_frame(outlink, out);
+    out = NULL;
 fail:
     av_frame_free(&in);
+    av_frame_free(&out);
     return ret;
 }
 



More information about the ffmpeg-cvslog mailing list