From c9465e476bf290a8db83f32a3f11bd999541ede9 Mon Sep 17 00:00:00 2001 From: Ruslan Kuchumov Date: Thu, 4 Sep 2014 16:02:51 +0000 Subject: [PATCH] segfault when no input files bugfix --- src/ccextractor.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ccextractor.c b/src/ccextractor.c index 6ddc74c3..ea34aad9 100644 --- a/src/ccextractor.c +++ b/src/ccextractor.c @@ -265,10 +265,13 @@ int main(int argc, char *argv[]) fatal(EXIT_TOO_MANY_INPUT_FILES, "TCP mode is not compatible with input files.\n"); } - wbout1.multiple_files = num_input_files > 0; - wbout1.first_input_file = inputfile[0]; - wbout2.multiple_files = num_input_files > 0; - wbout2.first_input_file = inputfile[0]; + if (num_input_files > 0) + { + wbout1.multiple_files = 1; + wbout1.first_input_file = inputfile[0]; + wbout2.multiple_files = 1; + wbout2.first_input_file = inputfile[0]; + } // teletext page number out of range if ((tlt_config.page != 0) && ((tlt_config.page < 100) || (tlt_config.page > 899))) {