mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-06 05:27:08 +00:00
ccx_decoders_common.c: Copy data type when creating a copy of the subtitle structure
This commit is contained in:
@@ -512,12 +512,12 @@ struct cc_subtitle* copy_subtitle(struct cc_subtitle *sub)
|
||||
struct cc_subtitle *sub_copy = NULL;
|
||||
sub_copy = malloc(sizeof(struct cc_subtitle));
|
||||
memcpy(sub_copy, sub, sizeof(struct cc_subtitle));
|
||||
sub_copy->datatype = sub->datatype;
|
||||
|
||||
if (sub->data)
|
||||
{
|
||||
sub_copy->data = malloc(sub->nb_data * sizeof(struct eia608_screen));
|
||||
memcpy(sub_copy->data, sub->data, sub->nb_data * sizeof(struct eia608_screen));
|
||||
sub_copy->datatype = sub->datatype;
|
||||
}
|
||||
return sub_copy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user