[vlc-commits] [Git][videolan/vlc][master] demux: mkv: avoid leaking elements we overwrite

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jan 9 03:36:24 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
804bb118 by Steve Lhomme at 2026-01-09T03:12:31+00:00
demux: mkv: avoid leaking elements we overwrite

Unless they are marked as for keeps.

Fixes #29519

- - - - -


1 changed file:

- modules/demux/mkv/Ebml_parser.cpp


Changes:

=====================================
modules/demux/mkv/Ebml_parser.cpp
=====================================
@@ -197,6 +197,14 @@ next:
 
     if (do_read)
     {
+        // avoid leaking previous element at the level we're reading
+        if(m_el[mi_level] != nullptr && !mb_keep)
+        {
+            assert(m_el[mi_level] == p_prev);
+            delete m_el[mi_level];
+            p_prev = nullptr;
+        }
+
         // If the parent is a segment, use the segment context when creating children
         // (to prolong their lifetime), otherwise just continue as normal
         EbmlSemanticContext e_context =



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/804bb1183da64866704d2aef79003af59784813b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/804bb1183da64866704d2aef79003af59784813b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list