probetest: check command line arguments
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 17:58:44 +0000 (19:58 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 18:35:56 +0000 (20:35 +0200)
Fixes CID733835
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tools/probetest.c

index f8a617d..29c27e4 100644 (file)
@@ -63,6 +63,16 @@ int main(int argc, char **argv)
     if(argc >= 3)
         max_size = atoi(argv[2]);
 
+    if (max_size > 1000000000U/8) {
+        fprintf(stderr, "max_size out of bounds\n");
+        return 1;
+    }
+
+    if (retry_count > 1000000000U) {
+        fprintf(stderr, "retry_count out of bounds\n");
+        return 1;
+    }
+
     avcodec_register_all();
     av_register_all();