[vlc-devel] [PATCH] MKV: we can read a Cluster with unknown size

Steve Lhomme robux4 at gmail.com
Fri Feb 20 16:27:48 CET 2015


It seems libavformat sets the last Cluster with an infinite/unknown size 
(at least in some files). We should read this Cluster, not assume it's 
too big.

---
  modules/demux/mkv/matroska_segment_parse.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp 
b/modules/demux/mkv/matroska_segment_parse.cpp
index 751c824..01ac81b 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1245,7 +1245,7 @@ void matroska_segment_c::ParseCluster( KaxCluster 
*cluster, bool b_update_start_

      /* Master elements */
      m = static_cast<EbmlMaster *>( cluster );
-    if( unlikely( m->GetSize() >= SIZE_MAX ) )
+    if( m->IsFiniteSize() && unlikely( m->GetSize() >= SIZE_MAX ) )
      {
          msg_Err( &sys.demuxer, "Cluster too big, aborting" );
          return;
-- 
1.9.5.msysgit.0




More information about the vlc-devel mailing list