[vlc-commits] access: dvdnav: check return for nav packets getters

Francois Cartegnie git at videolan.org
Fri Apr 3 10:52:31 CEST 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr  2 19:33:17 2020 +0200| [752a6a0bcbe34cc88943a9bc8c16b93d1de9439c] | committer: Francois Cartegnie

access: dvdnav: check return for nav packets getters

(cherry picked from commit 62a55b6aa6f7d41a815d33928f5ae6ecca9b40b9)

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

 modules/access/dvdnav.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index f8292d62a4..61a9157111 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -1064,10 +1064,16 @@ static int Demux( demux_t *p_demux )
         p_sys->i_vobu_flush = 0;
 
         /* Look if we have need to force a flush (and when) */
-        const pci_gi_t *p_pci_gi = &dvdnav_get_current_nav_pci( p_sys->dvdnav )->pci_gi;
+        const pci_t *p_pci = dvdnav_get_current_nav_pci( p_sys->dvdnav );
+        if( unlikely(!p_pci) )
+            break;
+        const pci_gi_t *p_pci_gi = &p_pci->pci_gi;
         if( p_pci_gi->vobu_se_e_ptm != 0 && p_pci_gi->vobu_se_e_ptm < p_pci_gi->vobu_e_ptm )
         {
-            const dsi_gi_t *p_dsi_gi = &dvdnav_get_current_nav_dsi( p_sys->dvdnav )->dsi_gi;
+            const dsi_t *p_dsi = dvdnav_get_current_nav_dsi( p_sys->dvdnav );
+            if( unlikely(!p_dsi) )
+                break;
+            const dsi_gi_t *p_dsi_gi = &p_dsi->dsi_gi;
             if( p_dsi_gi->vobu_3rdref_ea != 0 )
                 p_sys->i_vobu_flush = p_dsi_gi->vobu_3rdref_ea;
             else if( p_dsi_gi->vobu_2ndref_ea != 0 )



More information about the vlc-commits mailing list