[vlc-commits] Fix a crash in MKV when seeking to the last block of a cluster

Denis Charmet git at videolan.org
Wed Dec 7 02:27:42 CET 2011


vlc | branch: master | Denis Charmet <typx at dinauz.org> | Tue Dec  6 23:38:15 2011 +0100| [75fe29de25652698275aeaf9e6e831d24683659d] | committer: Jean-Baptiste Kempf

Fix a crash in MKV when seeking to the last block of a cluster

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

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

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

diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 69676bf..6c3aa67 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -88,10 +88,13 @@ EbmlElement* EbmlParser::UnGet( uint64 i_block_pos, uint64 i_cluster_pos )
     {
         // seek to the previous Cluster
         m_es->I_O().setFilePointer( i_cluster_pos, seek_beginning );
-        mi_level--;
-        mi_user_level--;
-        delete m_el[mi_level];
-        m_el[mi_level] = NULL;
+        while(mi_level > 1)
+        {
+            mi_level--;
+            mi_user_level--;
+            delete m_el[mi_level];
+            m_el[mi_level] = NULL;
+        }
         return NULL;
     }
 }



More information about the vlc-commits mailing list