[vlc-devel] [PATCH 1/4] mkv/demux: fix 17567: null-pointer dereference in EnsureDuration

Filip Roséen filip at atch.se
Mon Oct 31 01:05:53 CET 2016


Since matroska_segment_c::EnsureDuration calculates the duration by
using the timecode of the last block in the last cluster, and
subtracting that with the timecode of the first cluster found, the
previous implementation would if there was no clusters in the file.

These changes fixes that, and should be viewed as a fixup of f275663.

fixes #17567
---
 modules/demux/mkv/matroska_segment.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index f2557a0..acb8a54 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -686,7 +686,7 @@ bool matroska_segment_c::Preload( )
 
     b_preloaded = true;
 
-    if( cluster == NULL || cluster->IsFiniteSize() )
+    if( cluster && cluster->IsFiniteSize() )
         EnsureDuration();
 
     return true;
-- 
2.10.1



More information about the vlc-devel mailing list