summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-24 00:54:52 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-24 00:54:52 +0100
commitc89ed445b9fcd4d6c76cbf3278dd2d7d7e2e0a42 (patch)
tree108c1ef1e67b6bc2d0d9e55d4a7cfbf1f765ad89 /src/cpl.cc
parentb489c7ad24303799a32412e160fe27c4e9eddb29 (diff)
Only write the appropriate number of AudioChannelLabelSubDescriptors (DoM #2431).v1.8.54
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 74f6f0bd..d73def9f 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -512,6 +512,9 @@ CPL::maybe_write_composition_metadata_asset (xmlpp::Element* node) const
for (auto i: channels) {
auto channel = reinterpret_cast<ASDCP::MXF::AudioChannelLabelSubDescriptor*>(i);
+ if (static_cast<int>(channel->MCAChannelID) > asset->channels()) {
+ continue;
+ }
auto ch = mca_subs->add_child("AudioChannelLabelSubDescriptor", "r0");
channel->InstanceUID.EncodeString(buffer, sizeof(buffer));
ch->add_child("InstanceID", "r1")->add_child_text("urn:uuid:" + string(buffer));