[vlc-devel] [PATCH] demux:mkv: make sure the mkv_track_t memory is initialized

Steve Lhomme robux4 at videolabs.io
Wed Jul 12 14:35:27 CEST 2017


Successive calls to ParseTrackEntry() may reuse the same stack memory and
previous values not overridden by the new call.
---
 modules/demux/mkv/matroska_segment_parse.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index a79cfa0e9f..9959616adb 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -206,6 +206,7 @@ void matroska_segment_c::ParseTrackEntry( const KaxTrackEntry *m )
 
     /* Init the track */
     mkv_track_t track;
+    memset(&track, 0, sizeof(track));
 
     track.b_default              = true;
     track.b_enabled              = true;
-- 
2.12.1



More information about the vlc-devel mailing list