summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-07-12 11:31:03 -0700
committerJohn Stebbins <[email protected]>2019-08-11 15:54:27 -0700
commit93bbc62c454274b8be23705e10438fc0ee31ac24 (patch)
tree0f239a1b6612407259d28bf5d9f04f3ecf637477 /libhb/common.c
parent7e5b372eeb3db720b0bc22419f621f40eff6dd87 (diff)
libhb: eliminate file path length limits
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/libhb/common.c b/libhb/common.c
index df5d60467..554db5004 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -3681,7 +3681,7 @@ hb_title_t * hb_title_init( char * path, int index )
t->list_subtitle = hb_list_init();
t->list_attachment = hb_list_init();
t->metadata = hb_metadata_init();
- strncat(t->path, path, sizeof(t->path) - 1);
+ t->path = strdup(path);
// default to decoding mpeg2
t->video_id = 0xE0;
t->video_codec = WORK_DECAVCODECV;
@@ -3738,7 +3738,9 @@ void hb_title_close( hb_title_t ** _t )
hb_metadata_close( &t->metadata );
- free( t->video_codec_name );
+ free((char*)t->name);
+ free((char*)t->path);
+ free(t->video_codec_name);
free(t->container_name);
free( t );
@@ -4817,6 +4819,10 @@ hb_subtitle_t *hb_subtitle_copy(const hb_subtitle_t *src)
{
subtitle->config.name = strdup(src->config.name);
}
+ if (src->config.src_filename)
+ {
+ subtitle->config.src_filename = strdup(src->config.src_filename);
+ }
}
return subtitle;
}
@@ -4850,15 +4856,17 @@ hb_list_t *hb_subtitle_list_copy(const hb_list_t *src)
**********************************************************************
*
*********************************************************************/
-void hb_subtitle_close( hb_subtitle_t **sub )
+void hb_subtitle_close( hb_subtitle_t **_sub )
{
- if ( sub && *sub )
+ hb_subtitle_t * sub = *_sub;
+ if ( _sub && sub )
{
- free ((char*)(*sub)->name);
- free ((char*)(*sub)->config.name);
- free ((*sub)->extradata);
- free(*sub);
- *sub = NULL;
+ free((char*)sub->name);
+ free((char*)sub->config.name);
+ free((char*)sub->config.src_filename);
+ free(sub->extradata);
+ free(sub);
+ *_sub = NULL;
}
}
@@ -4919,6 +4927,7 @@ int hb_subtitle_add(const hb_job_t * job, const hb_subtitle_config_t * subtitlec
{
subtitle->config.name = strdup(subtitlecfg->name);
}
+ subtitle->config.src_filename = NULL;
subtitle->out_track = hb_list_count(job->list_subtitle) + 1;
hb_list_add(job->list_subtitle, subtitle);
return 1;
@@ -4962,6 +4971,7 @@ int hb_import_subtitle_add( const hb_job_t * job,
{
subtitle->config.name = strdup(subtitlecfg->name);
}
+ subtitle->config.src_filename = strdup(subtitlecfg->src_filename);
hb_list_add(job->list_subtitle, subtitle);
return 1;