[vlc-commits] demux:mkv: avoid recursive calls in case of bogus/dummy data

Steve Lhomme git at videolan.org
Mon Jan 22 15:46:48 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 22 15:13:59 2018 +0100| [a2216f9f44bc0c253fb02361dbd4373e18491288] | committer: Steve Lhomme

demux:mkv: avoid recursive calls in case of bogus/dummy data

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

 modules/demux/mkv/Ebml_parser.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 00b738c578..1595da4ba2 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -154,6 +154,7 @@ EbmlElement *EbmlParser::Get( int n_call )
         return ret;
     }
 
+next:
     p_prev = m_el[mi_level];
     if( p_prev )
         p_prev->SkipData( *m_es, EBML_CONTEXT(p_prev) );
@@ -267,7 +268,8 @@ EbmlElement *EbmlParser::Get( int n_call )
             /* The element fits inside its upper element */
             msg_Warn( p_demux, "Dummy element found %" PRIu64 "... skipping it",
                       m_el[mi_level]->GetElementPosition() );
-            return Get( ++n_call );
+            n_call++;
+            goto next;
         }
         else
         {



More information about the vlc-commits mailing list