Allow repeated VGMSTREAMs in segment layout

This commit is contained in:
bnnm 2019-08-25 20:18:27 +02:00
parent e473e7aba9
commit 5d8d462067

View File

@ -203,13 +203,23 @@ fail:
}
void free_layout_segmented(segmented_layout_data *data) {
int i;
int i, j;
if (!data)
return;
if (data->segments) {
for (i = 0; i < data->segment_count; i++) {
int is_repeat = 0;
/* segments are allowed to be repeated so don't close the same thing twice */
for (j = 0; j < i; j++) {
if (data->segments[i] == data->segments[j])
is_repeat = 1;
}
if (is_repeat)
continue;
close_vgmstream(data->segments[i]);
}
free(data->segments);