[vlc-commits] demux:mkv: do not even try to read bogus data if the size is 0

Steve Lhomme git at videolan.org
Mon Nov 27 20:55:53 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Mon Nov 27 17:31:54 2017 +0100| [44979951e682e3c146422fa3bcd02f63684eb0d4] | committer: Jean-Baptiste Kempf

demux:mkv: do not even try to read bogus data if the size is 0

The parser will go up one level by itself

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=44979951e682e3c146422fa3bcd02f63684eb0d4
---

 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 )



More information about the vlc-commits mailing list