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.

Originally committed as revision 21670 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Stefano Sabatini 15 years ago
parent 668fd14287
commit 9e5381a21b
  1. 6
      cmdutils.c

@ -170,8 +170,10 @@ unknown_opt:
} else if (po->flags & OPT_FLOAT) { } 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); *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) { } else if (po->flags & OPT_FUNC2) {
if(po->u.func2_arg(opt, arg)<0) if (po->u.func2_arg(opt, arg) < 0) {
goto unknown_opt; fprintf(stderr, "%s: invalid value '%s' for option '%s'\n", argv[0], arg, opt);
exit(1);
}
} else { } else {
po->u.func_arg(arg); po->u.func_arg(arg);
} }

Loading…
Cancel
Save