OSDN Git Service

ffmpeg: fix validity test for file index.
authorNicolas George <nicolas.george@normalesup.org>
Sun, 22 Apr 2012 10:11:50 +0000 (12:11 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sun, 22 Apr 2012 10:45:35 +0000 (12:45 +0200)
Also fix a typo in the next line.

ffmpeg.c

index f9a9158..0abed0c 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -862,8 +862,8 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
         char *p;
         int file_idx = strtol(in->name, &p, 0);
 
-        if (file_idx < 0 || file_idx > nb_input_files) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtegraph description %s.\n",
+        if (file_idx < 0 || file_idx >= nb_input_files) {
+            av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtergraph description %s.\n",
                    file_idx, fg->graph_desc);
             exit_program(1);
         }