diff options
-rw-r--r-- | gtk/src/hb-backend.c | 6 | ||||
-rw-r--r-- | libhb/common.h | 2 | ||||
-rw-r--r-- | macosx/Controller.m | 6 | ||||
-rw-r--r-- | test/test.c | 6 |
4 files changed, 13 insertions, 7 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 59228778d..f9687fa84 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -4722,8 +4722,10 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) sub_config.offset = ghb_settings_get_int(ssettings, "SrtOffset"); lang = ghb_settings_get_string(ssettings, "SrtLanguage"); code = ghb_settings_get_string(ssettings, "SrtCodeset"); - strncpy(sub_config.src_filename, filename, 128); - strncpy(sub_config.src_codeset, code, 40); + strncpy(sub_config.src_filename, filename, 255); + sub_config.src_filename[255] = 0; + strncpy(sub_config.src_codeset, code, 39); + sub_config.src_codeset[39] = 0; sub_config.force = 0; sub_config.dest = PASSTHRUSUB; sub_config.default_track = def; diff --git a/libhb/common.h b/libhb/common.h index bb394c4f4..0dd3a2d42 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -131,7 +131,7 @@ struct hb_subtitle_config_s int default_track; /* SRT subtitle tracks only */ - char src_filename[128]; + char src_filename[256]; char src_codeset[40]; int64_t offset; }; diff --git a/macosx/Controller.m b/macosx/Controller.m index 9c7f1999a..3cac7cc46 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -3158,8 +3158,10 @@ bool one_burned = FALSE; sub_config.offset = [[tempObject objectForKey:@"subtitleTrackSrtOffset"] intValue]; /* we need to srncpy file path and char code */ - strncpy(sub_config.src_filename, [[tempObject objectForKey:@"subtitleSourceSrtFilePath"] UTF8String], 128); - strncpy(sub_config.src_codeset, [[tempObject objectForKey:@"subtitleTrackSrtCharCode"] UTF8String], 40); + strncpy(sub_config.src_filename, [[tempObject objectForKey:@"subtitleSourceSrtFilePath"] UTF8String], 255); + sub_config.src_filename[255] = 0; + strncpy(sub_config.src_codeset, [[tempObject objectForKey:@"subtitleTrackSrtCharCode"] UTF8String], 39); + sub_config.src_codeset[39] = 0; sub_config.force = 0; sub_config.dest = PASSTHRUSUB; diff --git a/test/test.c b/test/test.c index e0ec36c8a..d6d0f5729 100644 --- a/test/test.c +++ b/test/test.c @@ -1968,8 +1968,10 @@ static int HandleEvents( hb_handle_t * h ) sub_config.default_track = ( srtdefault != -1 ) && ( srtdefault == i + 1 ); sub_config.force = 0; - strncpy( sub_config.src_filename, srtfile[i], 128); - strncpy( sub_config.src_codeset, codeset, 40); + strncpy( sub_config.src_filename, srtfile[i], 255); + sub_config.src_filename[255] = 0; + strncpy( sub_config.src_codeset, codeset, 39); + sub_config.src_codeset[39] = 0; sub_config.offset = offset; hb_srt_add( job, &sub_config, lang); |