[FFmpeg-cvslog] avfilter/af_afffilt: fix crash on error

Paul B Mahol git at videolan.org
Sun Feb 9 16:51:09 EET 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Feb  9 15:42:48 2020 +0100| [2174a315b46815ceb9ca9150650078b22ba0ad84] | committer: Paul B Mahol

avfilter/af_afffilt: fix crash on error

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

 libavfilter/af_afftfilt.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
index 7506aebe9f..a14dd280e0 100644
--- a/libavfilter/af_afftfilt.c
+++ b/libavfilter/af_afftfilt.c
@@ -176,13 +176,13 @@ static int config_input(AVFilterLink *inlink)
         ret = av_expr_parse(&s->real[ch], arg ? arg : last_expr, var_names,
                             NULL, NULL, func2_names, func2, 0, ctx);
         if (ret < 0)
-            break;
+            goto fail;
         if (arg)
             last_expr = arg;
         s->nb_exprs++;
     }
 
-    av_free(args);
+    av_freep(&args);
 
     args = av_strdup(s->img_str ? s->img_str : s->real_str);
     if (!args)
@@ -196,12 +196,12 @@ static int config_input(AVFilterLink *inlink)
         ret = av_expr_parse(&s->imag[ch], arg ? arg : last_expr, var_names,
                             NULL, NULL, func2_names, func2, 0, ctx);
         if (ret < 0)
-            break;
+            goto fail;
         if (arg)
             last_expr = arg;
     }
 
-    av_free(args);
+    av_freep(&args);
 
     s->fifo = av_audio_fifo_alloc(inlink->format, inlink->channels, s->window_size);
     if (!s->fifo)
@@ -223,6 +223,9 @@ static int config_input(AVFilterLink *inlink)
     if (!s->buffer)
         return AVERROR(ENOMEM);
 
+fail:
+    av_freep(&args);
+
     return ret;
 }
 



More information about the ffmpeg-cvslog mailing list