diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp index 96b4e693..3e912c6d 100644 --- a/src/EbmlMaster.cpp +++ b/src/EbmlMaster.cpp @@ -61,7 +61,11 @@ EbmlMaster::EbmlMaster(const EbmlMaster & ElementToClone) ElementList.reserve(ElementToClone.ListSize()); // add a clone of the list for (const auto& e : ElementToClone.ElementList) - ElementList.push_back(e->Clone()); + { + auto *clone = e->Clone(); + if (clone != nullptr) + ElementList.push_back(clone); + } } EbmlMaster::~EbmlMaster()