avfilter/vf_premultiply: fix memory-leak on failure
authorTimo Rothenpieler <timo@rothenpieler.org>
Wed, 8 Nov 2017 18:17:51 +0000 (19:17 +0100)
committerTimo Rothenpieler <timo@rothenpieler.org>
Mon, 13 Nov 2017 19:33:10 +0000 (20:33 +0100)
Fixes CID #1416352

libavfilter/vf_premultiply.c

index 5120adc..df4f265 100644 (file)
@@ -607,9 +607,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) {