]> git.sesse.net Git - vlc/commitdiff
Add a check against broken files (It would be great if someone that understand
authorLaurent Aimar <fenrir@videolan.org>
Tue, 9 Oct 2007 22:16:12 +0000 (22:16 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 9 Oct 2007 22:16:12 +0000 (22:16 +0000)
the mkv demuxer could double checked it)

modules/demux/mkv.cpp

index 6a42e2000200a66ab5b280552992f43ad73c0af5..5b483ce855bfbb0c933185cf50a051cf06b7f9e2 100644 (file)
@@ -3082,7 +3082,11 @@ void virtual_segment_c::PrepareChapters( )
         p_segment = linked_segments[i];
         // FIXME assume we have the same editions in all segments
         for (j=0; j<p_segment->stored_editions.size(); j++)
+        {
+            if( j >= p_editions->size() ) /* Protect against broken files (?) */
+                break;
             (*p_editions)[j]->Append( *p_segment->stored_editions[j] );
+        }
     }
 }