avfilter/vf_gblur: handle cases when parameters become invalid

This commit is contained in:
Paul B Mahol 2022-09-04 16:38:00 +02:00
parent b6e8fc1c20
commit 49a1de26ec
1 changed files with 6 additions and 0 deletions

View File

@ -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)