diff options
author | John Stebbins <[email protected]> | 2019-09-09 09:04:55 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2019-09-09 09:04:55 -0700 |
commit | f4b50aff66edc1fdcca9e3f0b3b5730a899c4592 (patch) | |
tree | f543c3745d2788788fa65b2aaedc8c4081b55963 /libhb | |
parent | bb80d647552636a5035b99a612592f8f622ad466 (diff) |
Fix initialization of empty "" subtitle name
Empty subtitle name could result in double free
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c index 554db5004..58a809720 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -4927,6 +4927,10 @@ int hb_subtitle_add(const hb_job_t * job, const hb_subtitle_config_t * subtitlec { subtitle->config.name = strdup(subtitlecfg->name); } + else + { + subtitle->config.name = NULL; + } subtitle->config.src_filename = NULL; subtitle->out_track = hb_list_count(job->list_subtitle) + 1; hb_list_add(job->list_subtitle, subtitle); @@ -4971,6 +4975,10 @@ int hb_import_subtitle_add( const hb_job_t * job, { subtitle->config.name = strdup(subtitlecfg->name); } + else + { + subtitle->config.name = NULL; + } subtitle->config.src_filename = strdup(subtitlecfg->src_filename); hb_list_add(job->list_subtitle, subtitle); |