]> git.sesse.net Git - ffmpeg/commitdiff
cmdutils: add OPT_INT check in parse_number_or_die()
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sat, 16 Apr 2011 11:41:53 +0000 (13:41 +0200)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sat, 16 Apr 2011 19:47:06 +0000 (21:47 +0200)
Check that the value passed for an OPT_INT option is an int, fail
otherwise.

cmdutils.c

index aa3096209458abf201e3977c8a94a8d85eeb9ea2..ff1b6aaedabe698f484d13a283ea1756ca0fe635 100644 (file)
@@ -106,6 +106,8 @@ double parse_number_or_die(const char *context, const char *numstr, int type, do
         error= "The value for %s was %s which is not within %f - %f\n";
     else if(type == OPT_INT64 && (int64_t)d != d)
         error= "Expected int64 for %s but found %s\n";
+    else if (type == OPT_INT && (int)d != d)
+        error= "Expected int for %s but found %s\n";
     else
         return d;
     fprintf(stderr, error, context, numstr, min, max);