[FFmpeg-cvslog] avfilter/vf_gblur: handle cases when parameters become invalid

Paul B Mahol git at videolan.org
Sun Sep 4 17:42:57 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Sep  4 16:38:00 2022 +0200| [49a1de26ec6c358e5367ba1fb6e5828196626201] | committer: Paul B Mahol

avfilter/vf_gblur: handle cases when parameters become invalid

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

 libavfilter/vf_gblur.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 8bb851a774..bb4c342116 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -207,6 +207,12 @@ static void set_params(float sigma, int steps, float *postscale, float *boundary
     *postscale = pow(dnu / lambda, steps);
     *boundaryscale = 1.0 / (1.0 - dnu);
     *nu = (float)dnu;
+    if (!isnormal(*postscale))
+        *postscale = 1.f;
+    if (!isnormal(*boundaryscale))
+        *boundaryscale = 1.f;
+    if (!isnormal(*nu))
+        *nu = 0.f;
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)



More information about the ffmpeg-cvslog mailing list