access: dvdread: fix null dereference on vts failure
authorFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 30 Jul 2019 20:27:31 +0000 (22:27 +0200)
committerHugo Beauzée-Luyssen <hugo@beauzee.fr>
Wed, 14 Aug 2019 12:03:49 +0000 (14:03 +0200)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
modules/access/dvdread.c

index 4490ebf..3ce5a8d 100644 (file)
@@ -322,6 +322,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     int *pi_int;
     int i;
 
+    if(unlikely(!p_sys->p_vts_file))
+        return VLC_EGENERIC;
+
     switch( i_query )
     {
         case DEMUX_GET_POSITION:
@@ -446,6 +449,9 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
+    if(unlikely(!p_sys->p_vts_file))
+        return VLC_DEMUXER_EOF;
+
     uint8_t p_buffer[DVD_VIDEO_LB_LEN * DVD_BLOCK_READ_ONCE];
     int i_blocks_once, i_read;