[FFmpeg-devel] [PATCH 7/9] avfilter/vf_premultiply: fix memory-leak on failure

Timo Rothenpieler timo at rothenpieler.org
Wed Nov 8 20:17:51 EET 2017


Fixes CID #1416352
---
 libavfilter/vf_premultiply.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_premultiply.c b/libavfilter/vf_premultiply.c
index 1af6433bc9..4b6abc6e73 100644
--- a/libavfilter/vf_premultiply.c
+++ b/libavfilter/vf_premultiply.c
@@ -609,9 +609,10 @@ static int activate(AVFilterContext *ctx)
         int64_t pts;
 
         if ((ret = ff_inlink_consume_frame(ctx->inputs[0], &frame)) > 0) {
-            if ((ret = filter_frame(ctx, &out, frame, frame)) < 0)
-                return ret;
+            ret = filter_frame(ctx, &out, frame, frame);
             av_frame_free(&frame);
+            if (ret < 0)
+                return ret;
             ret = ff_filter_frame(ctx->outputs[0], out);
         }
         if (ret < 0) {
-- 
2.14.2



More information about the ffmpeg-devel mailing list