Abort reading Matroska files when encountering an element with the size 0

This commit is contained in:
Moritz Bunkus 2010-04-07 12:19:41 +02:00
parent 9b4e496e1e
commit 74668193cc
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2010-04-07 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: Fixed a segfault when reading Matroska files
containing level 1 elements other than clusters with a size of 0.
2010-04-03 Moritz Bunkus <moritz@bunkus.org>
* Build system: The LINGUAS environment variable determines which

View File

@ -82,7 +82,7 @@ kax_file_c::read_next_level1_element_internal(uint32_t wanted_id) {
EbmlElement *l1 = read_one_element();
if (NULL != l1) {
bool ok = m_in->setFilePointer2(l1->GetElementPosition() + l1->ElementSize(), seek_beginning);
bool ok = (0 != l1->ElementSize()) && m_in->setFilePointer2(l1->GetElementPosition() + l1->ElementSize(), seek_beginning);
if (m_debug_read_next)
mxinfo(boost::format("kax_file::read_next_level1_element(): other level 1 element %1% new pos %2% fsize %3% epos %4% esize %5%\n")