aboutsummaryrefslogtreecommitdiffstats
path: root/cmdutils.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-02-25 14:15:52 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2008-02-25 14:15:52 +0000
commit7c84b8bcdd682712a7a6b65a9e10fea8bf981b3b (patch)
tree352a06405157abb9b6f5e2d3df07f570c9445f33 /cmdutils.c
parent60b5a745a91484ecc2697d9615d1314bdbfdbf51 (diff)
downloadffmpeg-7c84b8bcdd682712a7a6b65a9e10fea8bf981b3b.tar.gz
Make parse_options() use parse_number_or_die().
Patch by Stefano Sabatini stefano sabatini-lala poste it Originally committed as revision 12211 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmdutils.c b/cmdutils.c
index c01a6df247..0719063605 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <stdlib.h>
#include <errno.h>
+#include <math.h>
#include "avformat.h"
#include "avdevice.h"
@@ -122,11 +123,11 @@ unknown_opt:
} else if (po->flags & OPT_BOOL) {
*po->u.int_arg = 1;
} else if (po->flags & OPT_INT) {
- *po->u.int_arg = atoi(arg);
+ *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX);
} else if (po->flags & OPT_INT64) {
- *po->u.int64_arg = strtoll(arg, (char **)NULL, 10);
+ *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX);
} else if (po->flags & OPT_FLOAT) {
- *po->u.float_arg = atof(arg);
+ *po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -INFINITY, INFINITY);
} else if (po->flags & OPT_FUNC2) {
if(po->u.func2_arg(opt+1, arg)<0)
goto unknown_opt;