[FFmpeg-cvslog] ffmpeg: fix segfault with too many output files

Michael Niedermayer git at videolan.org
Sat Jun 4 01:46:16 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun  4 01:24:00 2011 +0200| [bfd3b70ac3162f028bbfa5a8cd47d2715d49f77e] | committer: Michael Niedermayer

ffmpeg: fix segfault with too many output files

Fixes Ticket219

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfd3b70ac3162f028bbfa5a8cd47d2715d49f77e
---

 ffmpeg.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index e5986a6..35436aa 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3863,6 +3863,11 @@ static void opt_output_file(const char *filename)
     AVFormatParameters params, *ap = ¶ms;
     AVOutputFormat *file_oformat;
 
+    if(nb_output_files >= FF_ARRAY_ELEMS(output_files)){
+        fprintf(stderr, "Too many output files\n");
+        ffmpeg_exit(1);
+    }
+
     if (!strcmp(filename, "-"))
         filename = "pipe:";
 



More information about the ffmpeg-cvslog mailing list