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

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


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

access: dvdread: fix null dereference on vts failure

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
(cherry picked from commit bbbdb833da9498733768430cf50d3b489c4ceb95)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

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

diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 8a406a9991..daaa1efb63 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -339,6 +339,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:
@@ -451,6 +454,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