Free the existing descriptor array, if any, before replacing it.
Fix leaks with the
validate.file.playback.scrub_forward_seeking.test-mpeg2-mp3_mxf scenario.
https://bugzilla.gnome.org/show_bug.cgi?id=748580
if (d->linked_track_id == package->tracks[i]->track_id ||
(d->linked_track_id == 0 && package->n_essence_tracks == 1 &&
(package->tracks[i]->type & 0xf0) == 0x30)) {
+ g_free (package->tracks[i]->descriptor);
package->tracks[i]->descriptor =
g_new0 (MXFMetadataFileDescriptor *, 1);
package->tracks[i]->descriptor[0] = d;
n_descriptor++;
}
+ g_free (package->tracks[i]->descriptor);
package->tracks[i]->descriptor =
g_new0 (MXFMetadataFileDescriptor *, n_descriptor);
package->tracks[i]->n_descriptor = n_descriptor;