Skip to content

Commit

Permalink
don't keep null clones
Browse files Browse the repository at this point in the history
This will crash in the destructor and many other places.

It's unlikely to happen by better safe than sorry.
  • Loading branch information
robUx4 committed Dec 18, 2023
1 parent 3ca96d4 commit c1788f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/EbmlMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c1788f5

Please sign in to comment.