[vlc-devel] [PATCH] demux:mkv: don't crash if a child element has an unknown size and the parent doesn't
Steve Lhomme
robux4 at videolabs.io
Wed Dec 6 10:31:48 CET 2017
libebml should be fixed not to allow this.
---
modules/demux/mkv/Ebml_parser.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 3f9a3ae668..139d93f312 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -180,10 +180,10 @@ EbmlElement *EbmlParser::Get( int n_call )
}
else {
size_t size_lvl = mi_level;
- while ( size_lvl && m_el[size_lvl-1]->IsFiniteSize() &&
+ while ( size_lvl && m_el[size_lvl-1]->IsFiniteSize() && m_el[size_lvl]->IsFiniteSize() &&
m_el[size_lvl-1]->GetEndPosition() == m_el[size_lvl]->GetEndPosition() )
size_lvl--;
- if (size_lvl == 0 || !m_el[size_lvl-1]->IsFiniteSize() )
+ if (size_lvl == 0 || !m_el[size_lvl-1]->IsFiniteSize() || !m_el[size_lvl]->IsFiniteSize() )
i_max_read = UINT64_MAX;
else {
uint64 top = m_el[size_lvl-1]->GetEndPosition();
--
2.14.2
More information about the vlc-devel
mailing list