From 5ce5dc7fae1c2c9b69282576da710171c5d92203 Mon Sep 17 00:00:00 2001 From: Saurabh Shrivastava Date: Mon, 6 Feb 2017 03:09:55 +0530 Subject: [PATCH] Fix for NULL output filename. If no -o is suppled with stdin/network etc, the output name generated was NULL, leading to creation of files like `.srt` which were in category of hidden files. --- src/lib_ccx/ccx_encoders_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib_ccx/ccx_encoders_common.c b/src/lib_ccx/ccx_encoders_common.c index 680712cd..b41ff596 100644 --- a/src/lib_ccx/ccx_encoders_common.c +++ b/src/lib_ccx/ccx_encoders_common.c @@ -817,6 +817,11 @@ static int init_output_ctx(struct encoder_ctx *ctx, struct encoder_cfg *cfg) basefilename = get_basename(ctx->first_input_file); extension = get_file_extension(cfg->write_format); + if (basefilename == NULL) + { + basefilename = get_basename("utitled"); + } + if (cfg->extract == 12) { ret = init_write(&ctx->out[0], create_outfilename(basefilename, "_1", extension), cfg->with_semaphore);