[FFmpeg-cvslog] r21670 - trunk/cmdutils.c

stefano subversion
Sun Feb 7 16:46:18 CET 2010


Author: stefano
Date: Sun Feb  7 16:46:18 2010
New Revision: 21670

Log:
Make parse_options() explicitely handle the case where an opt_func2
function returns a negative value, rather than erroneously trigger the
code which manages the case of unknown option.

Modified:
   trunk/cmdutils.c

Modified: trunk/cmdutils.c
==============================================================================
--- trunk/cmdutils.c	Sun Feb  7 16:13:56 2010	(r21669)
+++ trunk/cmdutils.c	Sun Feb  7 16:46:18 2010	(r21670)
@@ -170,8 +170,10 @@ unknown_opt:
             } else if (po->flags & OPT_FLOAT) {
                 *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
             } else if (po->flags & OPT_FUNC2) {
-                if(po->u.func2_arg(opt, arg)<0)
-                    goto unknown_opt;
+                if (po->u.func2_arg(opt, arg) < 0) {
+                    fprintf(stderr, "%s: invalid value '%s' for option '%s'\n", argv[0], arg, opt);
+                    exit(1);
+                }
             } else {
                 po->u.func_arg(arg);
             }



More information about the ffmpeg-cvslog mailing list