demux: mkv: fix potential leak of KaxBlockAdditions when seeking
authorSteve Lhomme <robux4@ycbcr.xyz>
Sun, 10 Nov 2024 09:48:38 +0000 (10:48 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
(cherry picked from commit f7c0d24733350e4c43a2dcb84e3106d9e2be9e7b)

Gbp-Pq: Name 0103-demux-mkv-fix-potential-leak-of-KaxBlockAdditions-wh.patch

modules/demux/mkv/matroska_segment_seeker.cpp

index c50a6585194d86dc23964a756aa0d9231c240eb0..105f00e25932c94e3de1158de36bc59d54fe9421 100644 (file)
@@ -366,7 +366,11 @@ SegmentSeeker::index_unsearched_range( matroska_segment_c& ms, Range search_area
 
         if( ms.BlockGet( block, simpleblock, additions,
                          &b_key_picture, &b_discardable_picture, &i_block_duration ) )
+        {
+            delete additions;
             break;
+        }
+        delete additions;
 
         if( simpleblock ) {
             block_pos = simpleblock->GetElementPosition();