[Matroska-devel] bug in KaxCluster copy ctor

Matthew Heaney matthewjheaney at hotmail.com
Wed Jan 20 22:36:52 CET 2010


The copy ctor for type KaxCluster (in KaxCluster.cpp) has a loop, that uses
an iterator to visit the items in a vector.  However, the iterator doesn't
get incremented, so there's an endless loop.


KaxCluster::KaxCluster(const KaxCluster & ElementToClone) 
 :EbmlMaster(ElementToClone)
 ,bSilentTracksUsed(ElementToClone.bSilentTracksUsed)
{
	// update the parent of each children
	std::vector<EbmlElement *>::const_iterator Itr =
ElementList.begin();
	while (Itr != ElementList.end())
	{
		if (EbmlId(**Itr) == KaxBlockGroup::ClassInfos.GlobalId) {
			static_cast<KaxBlockGroup
*>(*Itr)->SetParent(*this);
		} else if (EbmlId(**Itr) == KaxBlock::ClassInfos.GlobalId) {
			static_cast<KaxBlock
*>(*Itr)->SetParent(*this);
#if MATROSKA_VERSION >= 2
		} else if (EbmlId(**Itr) ==
KaxBlockVirtual::ClassInfos.GlobalId) {
			static_cast<KaxBlockVirtual
*>(*Itr)->SetParent(*this);
#endif // MATROSKA_VERSION
		}

            //MJH: you need to say this:
            //++Itr;
	}
}



BTW: Is there a preferred mechanism for reporting bugs?

Thanks,
Matt





More information about the Matroska-devel mailing list