]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
cmdline: Check options array for not working flag combinations
[ffmpeg] / cmdutils.c
index ed6951f6b7bc9726e0c2ec314539710587062911..db89256d0264a0c402bdee570ae78aca41270aec 100644 (file)
@@ -482,10 +482,22 @@ static void dump_argument(const char *a)
     fputc('"', report_file);
 }
 
+static void check_options(const OptionDef *po)
+{
+    while (po->name) {
+        if (po->flags & OPT_PERFILE)
+            av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT));
+        po++;
+    }
+}
+
 void parse_loglevel(int argc, char **argv, const OptionDef *options)
 {
     int idx = locate_option(argc, argv, options, "loglevel");
     const char *env;
+
+    check_options(options);
+
     if (!idx)
         idx = locate_option(argc, argv, options, "v");
     if (idx && argv[idx + 1])