[vlc-commits] commit: MKV : Fix some memory leaks in the EBML parser. (Jai Menon )

git at videolan.org git at videolan.org
Wed Jul 14 19:59:43 CEST 2010


vlc | branch: master | Jai Menon <jmenon86 at gmail.com> | Wed Jul 14 23:18:34 2010 +0530| [67ffa80ab226c41d78f5e147ead702f6a3bc7f34] | committer: Rémi Duraffort 

MKV : Fix some memory leaks in the EBML parser.

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

 modules/demux/mkv/Ebml_parser.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 355f9e5..9fcfa38 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -47,7 +47,13 @@ EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux
 
 EbmlParser::~EbmlParser( void )
 {
-    for( int i = 1; i < mi_level; i++ )
+    if( !mi_level )
+    {
+        delete m_el[1];
+        return;
+    }
+
+    for( int i = 1; i <= mi_level; i++ )
     {
         if( !mb_keep )
         {



More information about the vlc-commits mailing list