[vlc-commits] access: dvdread: fix null dereference on vts failure

Francois Cartegnie git at videolan.org
Wed Aug 14 18:13:26 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jul 30 22:27:31 2019 +0200| [bbbdb833da9498733768430cf50d3b489c4ceb95] | committer: Hugo Beauzée-Luyssen

access: dvdread: fix null dereference on vts failure

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/access/dvdread.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 4490ebf03c..3ce5a8d114 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -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;
 



More information about the vlc-commits mailing list