vlc | branch: master | Filip Roséen <[email protected]> | Fri Nov  4 16:47:07 2016 
+0100| [8ad7d9ceaf57149dfcd6903560007f354274f727] | committer: Thomas Guillem

demux/mkv: fix 17567: null-pointer dereference in EnsureDuration

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 crash if there was no clusters in the
file.

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

fixes #17567

Signed-off-by: Steve Lhomme <[email protected]>
Signed-off-by: Thomas Guillem <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8ad7d9ceaf57149dfcd6903560007f354274f727
---

 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 ca5f34c..b2323d7 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -687,7 +687,7 @@ bool matroska_segment_c::Preload( )
 
     b_preloaded = true;
 
-    if( cluster == NULL || cluster->IsFiniteSize() )
+    if( cluster && cluster->IsFiniteSize() )
         EnsureDuration();
 
     return true;

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to