[FFmpeg-devel] [PATCH 09/20] fftools/cmdutils: check valid flags for OPT_TYPE_FUNC

Anton Khirnov anton at khirnov.net
Mon Dec 18 11:57:11 EET 2023


SPEC and OFFSET do not make sense for functions.
---
 fftools/cmdutils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 6ca2efef4a..a52c7c5ae4 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -482,6 +482,9 @@ static void check_options(const OptionDef *po)
         if (po->flags & OPT_PERFILE)
             av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT));
 
+        if (po->type == OPT_TYPE_FUNC)
+            av_assert0(!(po->flags & (OPT_FLAG_OFFSET | OPT_FLAG_SPEC)));
+
         // OPT_FUNC_ARG can only be ser for OPT_TYPE_FUNC
         av_assert0((po->type == OPT_TYPE_FUNC) || !(po->flags & OPT_FUNC_ARG));
 
-- 
2.42.0



More information about the ffmpeg-devel mailing list