[vlc-commits] access: dvdnav: check return for nav packets getters
Francois Cartegnie
git at videolan.org
Thu Apr 2 20:36:23 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 2 19:33:17 2020 +0200| [62a55b6aa6f7d41a815d33928f5ae6ecca9b40b9] | committer: Francois Cartegnie
access: dvdnav: check return for nav packets getters
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=62a55b6aa6f7d41a815d33928f5ae6ecca9b40b9
---
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 2b8e8e59db..f082f1021b 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -1080,10 +1080,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