diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e6f6773f6a..0fa2fe8c52 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -612,7 +612,7 @@ static OutputStream *ost_iter(OutputStream *prev) for (; of_idx < nb_output_files; of_idx++) { OutputFile *of = output_files[of_idx]; - for (; ost_idx < of->nb_streams; ost_idx++) + if (ost_idx < of->nb_streams) return of->streams[ost_idx]; ost_idx = 0;