From: Gildas Bazin Date: Sun, 5 Jun 2005 18:07:08 +0000 (+0000) Subject: * modules/access/dvdnav.c,dvdread.c: don't crash if the DVD can't be decrypted/read. X-Git-Tag: 0.8.4~1540 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e5e9c9447c8408cc6ab9b7aec3478464ebe25a8b;p=vlc * modules/access/dvdnav.c,dvdread.c: don't crash if the DVD can't be decrypted/read. --- diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c index 475d2e616a..e0e75dd22d 100644 --- a/modules/access/dvdnav.c +++ b/modules/access/dvdnav.c @@ -292,7 +292,10 @@ static int Open( vlc_object_t *p_this ) if( dvdnav_title_play( p_sys->dvdnav, 1 ) != DVDNAV_STATUS_OK ) { - msg_Warn( p_demux, "cannot set title" ); + msg_Err( p_demux, "cannot set title (can't decrypt DVD?)" ); + dvdnav_close( p_sys->dvdnav ); + free( p_sys ); + return VLC_EGENERIC; } if( dvdnav_menu_call( p_sys->dvdnav, DVD_MENU_Title ) != diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c index 50f57ec08c..3192ba8a3b 100644 --- a/modules/access/dvdread.c +++ b/modules/access/dvdread.c @@ -263,7 +263,13 @@ static int Open( vlc_object_t *p_this ) p_sys->i_angle = val.i_int > 0 ? val.i_int : 1; DemuxTitles( p_demux, &p_sys->i_angle ); - DvdReadSetArea( p_demux, 0, 0, p_sys->i_angle ); + if( DvdReadSetArea( p_demux, 0, 0, p_sys->i_angle ) != VLC_SUCCESS ) + { + Close( p_this ); + msg_Err( p_demux, "DvdReadSetArea(0,0,%i) failed (can't decrypt DVD?)", + p_sys->i_angle ); + return VLC_EGENERIC; + } /* Update default_pts to a suitable value for dvdread access */ var_Create( p_demux, "dvdread-caching",