Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/lib_ccx/matroska.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ struct matroska_sub_sentence *parse_segment_cluster_block_group_block_additions(
struct block_addition *newBA = calloc(1, sizeof(struct block_addition));
if (newBA == NULL)
fatal(EXIT_NOT_ENOUGH_MEMORY, "In parse_segment_cluster_block_group_block_additions: Out of memory.");
newBA->message_buf = message;
char *current = message;
int lastIndex = 0;
int item = 0;
Expand Down Expand Up @@ -1898,14 +1899,31 @@ void free_sub_track(struct matroska_sub_track *track)
free(track->lang_ietf);
if (track->codec_id_string != NULL)
free(track->codec_id_string);

for (int i = 0; i < track->sentence_count; i++)
{
struct matroska_sub_sentence *sentence = track->sentences[i];

free(sentence->text);

if (sentence->blockaddition != NULL)
{
/* cue_settings_list is the base of the message buffer;
* cue_identifier and comment are pointers into it */
if (sentence->blockaddition->message_buf != NULL)
{
free(sentence->blockaddition->message_buf);
}

Comment on lines +1911 to +1917
free(sentence->blockaddition);
}

free(sentence);
}

if (track->sentences != NULL)
free(track->sentences);

free(track);
}

Expand Down
1 change: 1 addition & 0 deletions src/lib_ccx/matroska.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ struct block_addition
ULLONG cue_identifier_size;
char *comment;
ULLONG comment_size;
char *message_buf;
};

struct matroska_sub_sentence
Expand Down
Loading