[FFmpeg-devel] [PATCH 2/5] avfilter/avfilter: Actually error out on init error

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Sep 15 20:22:54 EEST 2021


Currently an error from init could be overwritten by successfully
setting the enable expression.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/avfilter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index c614eb0740..ce63b9762f 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -924,6 +924,8 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
         ret = ctx->filter->init(ctx);
     else if (ctx->filter->init_dict)
         ret = ctx->filter->init_dict(ctx, options);
+    if (ret < 0)
+        return ret;
 
     if (ctx->enable_str) {
         ret = set_enable_expr(ctx, ctx->enable_str);
@@ -931,7 +933,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
             return ret;
     }
 
-    return ret;
+    return 0;
 }
 
 int avfilter_init_str(AVFilterContext *filter, const char *args)
-- 
2.30.2



More information about the ffmpeg-devel mailing list