File: 0103-demux-mkv-fix-potential-leak-of-KaxBlockAdditions-wh.patch

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (25 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Sun, 10 Nov 2024 10:48:38 +0100
Subject: demux: mkv: fix potential leak of KaxBlockAdditions when seeking

(cherry picked from commit f7c0d24733350e4c43a2dcb84e3106d9e2be9e7b)
---
 modules/demux/mkv/matroska_segment_seeker.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp
index c50a658..105f00e 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -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();