ffmpeg: free threads on error conditions.
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 14 May 2013 23:08:18 +0000 (01:08 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 17 May 2013 21:25:54 +0000 (23:25 +0200)
Fixes Ticket2562

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1a36c756d8959207d3386f03e11c15216abc50b7)

ffmpeg.c

index 3eb15a6..04adc54 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -151,6 +151,8 @@ static struct termios oldtty;
 static int restore_tty;
 #endif
 
+static void free_input_threads(void);
+
 
 /* sub2video hack:
    Convert subtitles to video with alpha to insert them in filter graphs.
@@ -424,6 +426,9 @@ void av_noreturn exit_program(int ret)
         av_freep(&output_streams[i]->logfile_prefix);
         av_freep(&output_streams[i]);
     }
+#if HAVE_PTHREADS
+    free_input_threads();
+#endif
     for (i = 0; i < nb_input_files; i++) {
         avformat_close_input(&input_files[i]->ctx);
         av_freep(&input_files[i]);