[FFmpeg-devel] [PATCH] ffmpeg: fix validity test for file index.

Nicolas George nicolas.george at normalesup.org
Sun Apr 22 12:12:47 CEST 2012


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 ffmpeg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index e754fe4..cc2e1aa 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -862,7 +862,7 @@ 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) {
+        if (file_idx < 0 || file_idx >= nb_input_files) {
             av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtegraph description %s.\n",
                    file_idx, fg->graph_desc);
             exit_program(1);
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list