diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-02-07 15:46:18 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-02-07 15:46:18 +0000 |
commit | 9e5381a21b2106a012b92c1878886c5af4e1a932 (patch) | |
tree | fdd38d3b7ebd6d21685c548e2f85dc284cce7afc /cmdutils.c | |
parent | 668fd14287c81f3ddda5fef070160a8de32413b2 (diff) | |
download | ffmpeg-9e5381a21b2106a012b92c1878886c5af4e1a932.tar.gz |
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
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmdutils.c b/cmdutils.c index 90dfccf445..450ae3224f 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -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); } |