[vlc-devel] [PATCH 1/2] demux:mkv: do not even try to read bogus data if the size is 0

Steve Lhomme robux4 at videolabs.io
Mon Nov 27 17:31:54 CET 2017


The parser will go up one level by itself
---
 modules/demux/mkv/Ebml_parser.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index eb76e780eb..f503493213 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -187,7 +187,8 @@ EbmlElement *EbmlParser::Get( int n_call )
             : EBML_CONTEXT(m_el[mi_level - 1]);
 
     /* Ignore unknown level 0 or 1 elements */
-    m_el[mi_level] = m_es->FindNextElement( e_context,
+    m_el[mi_level] = unlikely(!i_max_read) ? NULL :
+                     m_es->FindNextElement( e_context,
                                             i_ulev, i_max_read,
                                             (  mb_dummy | (mi_level > 1) ), 1 );
     if( i_ulev > 0 )
-- 
2.14.2



More information about the vlc-devel mailing list