vlc/vlc-3.0 | branch: master | Steve Lhomme <rob...@ycbcr.xyz> | Fri Apr  6 
11:26:09 2018 +0200| [4fb86a074c5fe6cd4affdb2e5e85f732a5b8fff6] | committer: 
Hugo Beauzée-Luyssen

demux:mkv: fix crash on dummy edition

(cherry picked from commit 6225003ec87a71223a345091086e54fd82e2cb4f)
Signed-off-by: Hugo Beauzée-Luyssen <h...@beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4fb86a074c5fe6cd4affdb2e5e85f732a5b8fff6
---

 modules/demux/mkv/virtual_segment.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/virtual_segment.cpp 
b/modules/demux/mkv/virtual_segment.cpp
index b5958d4754..8a0f1ca2cf 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -172,7 +172,7 @@ virtual_edition_c::virtual_edition_c( chapter_edition_c * 
p_edit, matroska_segme
         tmp = 0;
 
         /* Append the main segment */
-        p_vchap = virtual_chapter_c::CreateVirtualChapter( (chapter_item_c*) 
p_edit, main_segment,
+        p_vchap = virtual_chapter_c::CreateVirtualChapter( p_edit, 
main_segment,
                                                            opened_segments, 
tmp, b_ordered );
         if( p_vchap )
             vchapters.push_back( p_vchap );
@@ -448,7 +448,8 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & 
demux )
     /* we have moved to a new chapter */
     if ( p_cur_vchapter != NULL && p_current_vchapter != p_cur_vchapter )
         {
-            msg_Dbg( &demux, "New Chapter %" PRId64 " uid=%" PRIu64, sys.i_pts 
- VLC_TS_0, p_cur_vchapter->p_chapter->i_uid );
+            msg_Dbg( &demux, "New Chapter %" PRId64 " uid=%" PRIu64, sys.i_pts 
- VLC_TS_0,
+                     p_cur_vchapter->p_chapter ? 
p_cur_vchapter->p_chapter->i_uid : 0 );
             if ( p_cur_vedition->b_ordered )
             {
                 /* FIXME EnterAndLeave has probably been broken for a long 
time */

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to