aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avf_showcwt.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-07-22 17:25:06 +0200
committerPaul B Mahol <onemda@gmail.com>2023-07-22 18:05:38 +0200
commitffa3edbf5137f1180e85b10d958c2e096d955831 (patch)
treeb470ee928c0f457f341b8144bc218d4bc0b89b97 /libavfilter/avf_showcwt.c
parentc24c7bcc951056c2a47bbb292edb56737fb436da (diff)
downloadffmpeg-ffa3edbf5137f1180e85b10d958c2e096d955831.tar.gz
avfilter/avf_showcwt: extend min frequency accepted range
Also always check that min frequency is lower than max frequency.
Diffstat (limited to 'libavfilter/avf_showcwt.c')
-rw-r--r--libavfilter/avf_showcwt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavfilter/avf_showcwt.c b/libavfilter/avf_showcwt.c
index d83aad57f5..120ce63b62 100644
--- a/libavfilter/avf_showcwt.c
+++ b/libavfilter/avf_showcwt.c
@@ -133,8 +133,8 @@ static const AVOption showcwt_options[] = {
{ "sqrt", "sqrt", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_SQRT}, 0, 0, FLAGS, "scale" },
{ "cbrt", "cbrt", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_CBRT}, 0, 0, FLAGS, "scale" },
{ "qdrt", "qdrt", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_QDRT}, 0, 0, FLAGS, "scale" },
- { "min", "set minimum frequency", OFFSET(minimum_frequency), AV_OPT_TYPE_FLOAT, {.dbl = 20.}, 1, 2000, FLAGS },
- { "max", "set maximum frequency", OFFSET(maximum_frequency), AV_OPT_TYPE_FLOAT, {.dbl = 20000.}, 0, 192000, FLAGS },
+ { "min", "set minimum frequency", OFFSET(minimum_frequency), AV_OPT_TYPE_FLOAT, {.dbl = 20.}, 1, 192000, FLAGS },
+ { "max", "set maximum frequency", OFFSET(maximum_frequency), AV_OPT_TYPE_FLOAT, {.dbl = 20000.}, 1, 192000, FLAGS },
{ "logb", "set logarithmic basis", OFFSET(logarithmic_basis), AV_OPT_TYPE_FLOAT, {.dbl = 0.0001}, 0, 1, FLAGS },
{ "deviation", "set frequency deviation", OFFSET(deviation), AV_OPT_TYPE_FLOAT, {.dbl = 1.}, 0, 10, FLAGS },
{ "pps", "set pixels per second", OFFSET(pps), AV_OPT_TYPE_INT, {.i64 = 64}, 1, 1024, FLAGS },
@@ -686,6 +686,12 @@ static int config_output(AVFilterLink *outlink)
float scale = 1.f, factor;
int ret;
+ if (minimum_frequency >= maximum_frequency) {
+ av_log(ctx, AV_LOG_ERROR, "min frequency (%f) >= (%f) max frequency\n",
+ minimum_frequency, maximum_frequency);
+ return AVERROR(EINVAL);
+ }
+
uninit(ctx);
s->fdsp = avpriv_float_dsp_alloc(0);